Skip to content
Permalink
Browse files

[FIXED JENKINS-34900] Fix NPE when single Maven module is triggered.

  • Loading branch information
ikedam committed May 21, 2016
1 parent 6762fc8 commit cbd89e56abe77230f0ad6eff43ee697b6d110925
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/main/java/com/chikli/hudson/plugin/naginator/NaginatorListener.java
@@ -91,7 +91,13 @@ public void onCompleted(AbstractBuild<?, ?> build, @Nonnull TaskListener listene
public Environment setUpEnvironment(@SuppressWarnings("rawtypes") AbstractBuild build, Launcher launcher, BuildListener listener)
throws IOException, InterruptedException, RunnerAbortedException
{
final NaginatorAction action = build.getRootBuild().getAction(NaginatorAction.class);
AbstractBuild<?, ?> rootBuild = build.getRootBuild();
if (rootBuild == null) {
// getRootBuild() should not be null,
// but some builds irregularly returns null.
rootBuild = build;
}
final NaginatorAction action = rootBuild.getAction(NaginatorAction.class);
if (action == null) {
return null;
}

0 comments on commit cbd89e5

Please sign in to comment.
You can’t perform that action at this time.