mirror of
https://github.com/apache/sqoop.git
synced 2025-05-10 02:40:49 +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:
parent
e8ca6f6c93
commit
b80b2d8e63
@ -727,6 +727,11 @@ public boolean existsJob(long id, Connection conn) {
|
|||||||
public boolean inUseJob(long jobId, Connection conn) {
|
public boolean inUseJob(long jobId, Connection conn) {
|
||||||
MSubmission submission = findSubmissionLastForJob(jobId, 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
|
// We can't remove running job
|
||||||
if(submission.getStatus().isRunning()) {
|
if(submission.getStatus().isRunning()) {
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user