diff --git a/src/main/java/hudson/maven/AbstractMavenBuilder.java b/src/main/java/hudson/maven/AbstractMavenBuilder.java index ebf7a55b..0a9d01c0 100644 --- a/src/main/java/hudson/maven/AbstractMavenBuilder.java +++ b/src/main/java/hudson/maven/AbstractMavenBuilder.java @@ -98,7 +98,13 @@ protected AbstractMavenBuilder(BuildListener listener, Collection m void end(Launcher launcher) throws IOException, InterruptedException { for (Map.Entry e : sourceProxies.entrySet()) { ProxyImpl2 p = e.getValue(); - for (MavenReporter r : reporters.get(e.getKey())) { + ModuleName module = e.getKey(); + List moduleReporters = reporters.get(module); + if (moduleReporters == null) { + // Safety: Key set of reporter and source list has become inconsistent. + continue; + } + for (MavenReporter r : moduleReporters) { // we'd love to do this when the module build ends, but doing so requires // we know how many task segments are in the current build. r.end(p.owner(),launcher,listener);