avoid NPE

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@34154 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2010-08-26 19:02:39 +00:00
1 parent 76c65a333c
commit 9d74a9005f
1 file changed
+3 -1
@@ -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