Skip to content

Commit

Permalink
fix 删除suspend job时null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
xionghan00 committed Jun 1, 2017
1 parent 1eadde6 commit 31f712d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,14 @@ public RestfulResponse suspendJobDelete(JobQueueReq request) {
if (StringUtils.isEmpty(request.getJobId())) {
return Builder.build(false, "JobId 必须传!");
}

JobPo jobPo = appContext.getSuspendJobQueue().getJob(request.getJobId());
if (jobPo == null) {
return Builder.build(true, "已经删除");
}

boolean success = appContext.getSuspendJobQueue().remove(request.getJobId());
if (success) {
JobPo jobPo = appContext.getSuspendJobQueue().getJob(request.getJobId());
JobLogUtils.log(LogType.DEL, jobPo, appContext.getJobLogger());
}
return Builder.build(success);
Expand Down

0 comments on commit 31f712d

Please sign in to comment.