diff --git a/src/main/java/jenkins/plugins/slack/ActiveNotifier.java b/src/main/java/jenkins/plugins/slack/ActiveNotifier.java index cfa5c911..619feedd 100755 --- a/src/main/java/jenkins/plugins/slack/ActiveNotifier.java +++ b/src/main/java/jenkins/plugins/slack/ActiveNotifier.java @@ -104,7 +104,7 @@ public void finalized(AbstractBuild r) { AbstractProject project = r.getProject(); Result result = r.getResult(); AbstractBuild previousBuild = project.getLastBuild(); - if (null != previousBuild) { + if (null != previousBuild && !r.isBuilding()) { do { previousBuild = previousBuild.getPreviousCompletedBuild(); } while (previousBuild != null && previousBuild.getResult() == Result.ABORTED); @@ -123,7 +123,7 @@ public void completed(AbstractBuild r) { AbstractProject project = r.getProject(); Result result = r.getResult(); AbstractBuild previousBuild = project.getLastBuild(); - if (null != previousBuild) { + if (null != previousBuild && !r.isBuilding()) { do { previousBuild = previousBuild.getPreviousCompletedBuild(); } while (null != previousBuild && previousBuild.getResult() == Result.ABORTED);