From 345b3bb3743f93a797c843bfc51d95a90093f144 Mon Sep 17 00:00:00 2001 From: Christoph Kutzinski Date: Sat, 16 Jul 2011 19:02:44 +0200 Subject: [PATCH] [FIXED JENKINS-9822] occasional NPE when running maven jobs --- changelog.html | 3 +++ maven-plugin/src/main/java/hudson/maven/MavenBuild.java | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index fc28f25e63c5..1bf6f1747d81 100644 --- a/changelog.html +++ b/changelog.html @@ -58,6 +58,9 @@
  • Fixed a race condition in the fingerprint computation (issue 10346) +
  • + Fixed an occasional NPE when running Maven jobs + (issue 9822) diff --git a/maven-plugin/src/main/java/hudson/maven/MavenBuild.java b/maven-plugin/src/main/java/hudson/maven/MavenBuild.java index f5c0859cc157..cff51bf20ba2 100644 --- a/maven-plugin/src/main/java/hudson/maven/MavenBuild.java +++ b/maven-plugin/src/main/java/hudson/maven/MavenBuild.java @@ -540,7 +540,7 @@ public void end() { } /** - * Sends the accumuldated log in {@link SplittableBuildListener} to the log of this build. + * Sends the accumulated log in {@link SplittableBuildListener} to the log of this build. */ public void appendLastLog() { try { @@ -586,6 +586,11 @@ public void cleanUp(BuildListener listener) { private void rememberModulesToBuildAgainNextTime() { MavenModuleSetBuild moduleSetBuild = getModuleSetBuild(); + if (moduleSetBuild == null) { + // ModuleSetBuild is gone, for whatever reason JENKINS-9822 + return; + } + if(hasntStartedYet()) { // record modules which have not been build though they should have - i.e. because they // have SCM changes.