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
This commit is contained in:
kohsuke committed 2010-03-16 18:55:58 +00:00
1 parent 180d68c0b9
commit 01bc7dc23e
1 file changed
+2 -1
@@ -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<FilePath, IOException>() {
store = (channel==null ? MasterComputer.localChannel : channel).call(new Callable<FilePath, IOException>() {
public FilePath call() throws IOException {
File home = new File(System.getProperty("user.home"));
return new FilePath(new File(home, ".hudson/cli-credentials"));