Skip to content

Commit

Permalink
JENKINS-43642 Fix NPE thrown in pipeline job during restart and recon…
Browse files Browse the repository at this point in the history
…figuration.
  • Loading branch information
ceilfors committed Aug 7, 2017
1 parent a954473 commit 9555dfb
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -71,7 +71,12 @@ abstract class JiraTrigger<T> extends Trigger<Job> {
@Override
void stop() {
super.stop()
jiraTriggerDescriptor.removeTrigger(this)
// Avoid null as this method might be called more than once as per Trigger#stop documentation:
// "Under some circumstances, this may be invoked more than once for a given Trigger,
// so be prepared for that."
if (job) {
jiraTriggerDescriptor.removeTrigger(this)
}
}

Job getJob() {
Expand Down

0 comments on commit 9555dfb

Please sign in to comment.