From 33573ca2bdaf7dbe8db841e0d09663b2c4abb85e Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Tue, 14 Dec 2010 11:36:04 -0800 Subject: [PATCH] [FIXED HUDSON-3696] Contract violation. This shouldn't be null. --- changelog.html | 3 +++ core/src/main/java/hudson/slaves/SlaveComputer.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 2fe6364a54..26bb4b6fc0 100644 --- a/changelog.html +++ b/changelog.html @@ -46,6 +46,9 @@ Upcoming changes
  • Fixed a pipe leak to child processes. (issue 8244) +
  • + Fixed an NPE in ComputerRetentionWork + (issue 3696)
  • Debian package init script now honors ~/.profile.
  • diff --git a/core/src/main/java/hudson/slaves/SlaveComputer.java b/core/src/main/java/hudson/slaves/SlaveComputer.java index f4072a9725..62a8fdcf98 100644 --- a/core/src/main/java/hudson/slaves/SlaveComputer.java +++ b/core/src/main/java/hudson/slaves/SlaveComputer.java @@ -445,7 +445,7 @@ public class SlaveComputer extends Computer { public RetentionStrategy getRetentionStrategy() { Slave n = getNode(); - return n==null ? null : n.getRetentionStrategy(); + return n==null ? RetentionStrategy.INSTANCE : n.getRetentionStrategy(); } /**