-
Bug
-
Resolution: Unresolved
-
Minor
-
None
The following patch will prevent the plugin from showing NullPointerExceptions in the logfile if projects are not run yet or did not yet report coverage data.
diff --git a/src/main/java/jenkins/plugins/emmacoveragecolumn/EmmaColumn.java b/src/main/java/jenkins/plugins/emmacoveragecolumn/EmmaColumn.java index 34fe2c0..e60897a 100644 --- a/src/main/java/jenkins/plugins/emmacoveragecolumn/EmmaColumn.java +++ b/src/main/java/jenkins/plugins/emmacoveragecolumn/EmmaColumn.java @@ -76,9 +76,17 @@ public class EmmaColumn extends ListViewColumn { } private Float getPercentageFloat(final Run<?, ?> lastSuccessfulBuild) { + if(lastSuccessfulBuild == null) { + return new Float(0); + } + final EmmaBuildAction action = lastSuccessfulBuild .getAction(EmmaBuildAction.class); + if(action == null) { + return new Float(0); + } + final CoverageReport result = action.getResult(); final Ratio ratio = result.getLineCoverage();