From 01bc7dc23ec0978432fe1277436ba709f8aa70ca Mon Sep 17 00:00:00 2001 From: kohsuke Date: Tue, 16 Mar 2010 18:55:58 +0000 Subject: [PATCH] fixed NPE that breaks some tests git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@28745 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/cli/ClientAuthenticationCache.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/cli/ClientAuthenticationCache.java b/core/src/main/java/hudson/cli/ClientAuthenticationCache.java index 73a66380c1..03d9ffc15c 100644 --- a/core/src/main/java/hudson/cli/ClientAuthenticationCache.java +++ b/core/src/main/java/hudson/cli/ClientAuthenticationCache.java @@ -3,6 +3,7 @@ package hudson.cli; import hudson.FilePath; import hudson.FilePath.FileCallable; import hudson.model.Hudson; +import hudson.model.Hudson.MasterComputer; import hudson.os.PosixAPI; import hudson.remoting.Callable; import hudson.remoting.Channel; @@ -43,7 +44,7 @@ public class ClientAuthenticationCache implements Serializable { private final Properties props = new Properties(); public ClientAuthenticationCache(Channel channel) throws IOException, InterruptedException { - store = channel.call(new Callable() { + store = (channel==null ? MasterComputer.localChannel : channel).call(new Callable() { public FilePath call() throws IOException { File home = new File(System.getProperty("user.home")); return new FilePath(new File(home, ".hudson/cli-credentials"));