diff --git a/core/src/main/java/io/jenkins/pluginhealth/scoring/probes/CodeCoverageProbe.java b/core/src/main/java/io/jenkins/pluginhealth/scoring/probes/CodeCoverageProbe.java index 63823d5a4..7889910f4 100644 --- a/core/src/main/java/io/jenkins/pluginhealth/scoring/probes/CodeCoverageProbe.java +++ b/core/src/main/java/io/jenkins/pluginhealth/scoring/probes/CodeCoverageProbe.java @@ -60,6 +60,9 @@ public class CodeCoverageProbe extends Probe { protected ProbeResult doApply(Plugin plugin, ProbeContext context) { final io.jenkins.pluginhealth.scoring.model.updatecenter.Plugin ucPlugin = context.getUpdateCenter().plugins().get(plugin.getName()); + if (ucPlugin == null) { + return error("Plugin cannot be found in Update-Center."); + } final String defaultBranch = ucPlugin.defaultBranch(); if (defaultBranch == null || defaultBranch.isBlank()) { return this.error("No default branch configured for the plugin."); diff --git a/core/src/main/java/io/jenkins/pluginhealth/scoring/probes/SpotBugsProbe.java b/core/src/main/java/io/jenkins/pluginhealth/scoring/probes/SpotBugsProbe.java index 8a398cd1a..3947976c3 100644 --- a/core/src/main/java/io/jenkins/pluginhealth/scoring/probes/SpotBugsProbe.java +++ b/core/src/main/java/io/jenkins/pluginhealth/scoring/probes/SpotBugsProbe.java @@ -50,6 +50,9 @@ public class SpotBugsProbe extends Probe { protected ProbeResult doApply(Plugin plugin, ProbeContext context) { final io.jenkins.pluginhealth.scoring.model.updatecenter.Plugin ucPlugin = context.getUpdateCenter().plugins().get(plugin.getName()); + if (ucPlugin == null) { + return error("Plugin cannot be found in Update-Center."); + } final String defaultBranch = ucPlugin.defaultBranch(); if (defaultBranch == null || defaultBranch.isBlank()) { return this.error("No default branch configured for the plugin.");