Skip to content

Commit

Permalink
[JENKINS-38542] NPE when canceling a task when no job
Browse files Browse the repository at this point in the history
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
  • Loading branch information
alonbl committed May 24, 2017
1 parent 35a03f0 commit 1d32470
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -550,7 +550,11 @@ public static GerritTrigger getTrigger(@Nullable Job project) {
*/
public void cancelTimer() {
if (gerritTriggerTimerTask != null) {
logger.trace("GerritTrigger.cancelTimer(): {0}", job.getName());
String name = "N/A";
if (job != null) {
name = job.getName();
}
logger.trace("GerritTrigger.cancelTimer(): {}", name);
gerritTriggerTimerTask.cancel();
gerritTriggerTimerTask = null;
}
Expand Down

0 comments on commit 1d32470

Please sign in to comment.