From 9d74a9005f7cdcbc2b1a7396bbbf2875c8dfb537 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Thu, 26 Aug 2010 19:02:39 +0000 Subject: [PATCH] avoid NPE git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@34154 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/slaves/ComputerRetentionWork.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/slaves/ComputerRetentionWork.java b/core/src/main/java/hudson/slaves/ComputerRetentionWork.java index 50cb6858f0..25c3805a4f 100644 --- a/core/src/main/java/hudson/slaves/ComputerRetentionWork.java +++ b/core/src/main/java/hudson/slaves/ComputerRetentionWork.java @@ -28,6 +28,7 @@ import java.util.WeakHashMap; import hudson.model.Computer; import hudson.model.Hudson; +import hudson.model.Node; import hudson.model.PeriodicWork; import hudson.Extension; @@ -56,7 +57,8 @@ public class ComputerRetentionWork extends PeriodicWork { protected void doRun() { final long startRun = System.currentTimeMillis(); for (Computer c : Hudson.getInstance().getComputers()) { - if (c.getNode().isHoldOffLaunchUntilSave()) + Node n = c.getNode(); + if (n!=null && n.isHoldOffLaunchUntilSave()) continue; if (!nextCheck.containsKey(c) || startRun > nextCheck.get(c)) { // at the moment I don't trust strategies to wait more than 60 minutes