Skip to content

Commit

Permalink
[FIXED JENKINS-34900] Fix NPE when single Maven module is triggered.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikedam committed May 21, 2016
1 parent 6762fc8 commit cbd89e5
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -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;
}
Expand Down

0 comments on commit cbd89e5

Please sign in to comment.