5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-10 00:13:17 +08:00

SQOOP-879: NPE when deleting job object that do not have associated any submissions

(Jarcec Cecho via Cheolsoo Park)
This commit is contained in:
Cheolsoo Park 2013-02-10 13:17:05 -08:00
parent e8ca6f6c93
commit b80b2d8e63

View File

@ -727,6 +727,11 @@ public boolean existsJob(long id, Connection conn) {
public boolean inUseJob(long jobId, Connection conn) {
MSubmission submission = findSubmissionLastForJob(jobId, conn);
// We have no submissions and thus job can't be in use
if(submission == null) {
return false;
}
// We can't remove running job
if(submission.getStatus().isRunning()) {
return true;