Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-25312] - Prevent NPE if build has not been finished yet
May appear if somebody calls the publisher using AnyBuildStep

Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
  • Loading branch information
oleg-nenashev committed Nov 7, 2014
1 parent 97f1c9d commit 06b886a
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -109,7 +109,10 @@ private void updateCommitStatus(@Nonnull AbstractBuild<?, ?> build, @Nonnull Bui
final String duration = Util.getTimeSpanString(System.currentTimeMillis() - build.getTimeInMillis());

Result result = build.getResult();
if (result.isBetterOrEqualTo(SUCCESS)) {
if (result == null) { // Build is ongoing
state = GHCommitState.PENDING;
msg = Messages.CommitNotifier_Pending(build.getDisplayName());
} else if (result.isBetterOrEqualTo(SUCCESS)) {
state = GHCommitState.SUCCESS;
msg = Messages.CommitNotifier_Success(build.getDisplayName(), duration);
} else if (result.isBetterOrEqualTo(UNSTABLE)) {
Expand Down

0 comments on commit 06b886a

Please sign in to comment.