Skip to content

Commit a0b2698

Browse files
committed
Thank you SpotBugs, this would really have an NPE
1 parent abe5bcb commit a0b2698

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesAgentErrorCondition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public boolean test(Throwable t, StepContext context) throws IOException, Interr
9999
if (n != null) {
100100
if (!(n instanceof KubernetesSlave)) {
101101
if (!handleNonKubernetes) {
102-
listener.getLogger().println(n.getNodeName() + " was not a Kubernetes agent");
102+
listener.getLogger().println(node + " was not a Kubernetes agent");
103103
}
104104
return handleNonKubernetes;
105105
}
@@ -108,7 +108,7 @@ public boolean test(Throwable t, StepContext context) throws IOException, Interr
108108
Set<LabelAtom> labels = ws.getLabels();
109109
if (labels.stream().noneMatch(l -> Jenkins.get().clouds.stream().anyMatch(c -> c instanceof KubernetesCloud && ((KubernetesCloud) c).getTemplate(l) != null))) {
110110
if (!handleNonKubernetes) {
111-
listener.getLogger().println(n.getNodeName() + " was not a Kubernetes agent judging by " + labels);
111+
listener.getLogger().println(node + " was not a Kubernetes agent judging by " + labels);
112112
}
113113
return handleNonKubernetes;
114114
}

0 commit comments

Comments
 (0)