Ensure home directory not null before using in Sshdsessionfactory
Home directory might not be set in DFS. Change-Id: I3528685838065dc291826fc73a37126af7bf47ce
This commit is contained in:
parent
f90f0717a0
commit
ba1653162c
|
@ -244,11 +244,13 @@ public SshdSession getSession(URIish uri,
|
|||
JGitSshClient.PREFERRED_AUTHENTICATIONS,
|
||||
defaultAuths);
|
||||
}
|
||||
try {
|
||||
jgitClient.setAttribute(JGitSshClient.HOME_DIRECTORY,
|
||||
home.getAbsoluteFile().toPath());
|
||||
} catch (SecurityException | InvalidPathException e) {
|
||||
if (home != null && home.getAbsoluteFile() != null) {
|
||||
try {
|
||||
jgitClient.setAttribute(JGitSshClient.HOME_DIRECTORY,
|
||||
home.getAbsoluteFile().toPath());
|
||||
} catch (SecurityException | InvalidPathException e) {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
// Other things?
|
||||
return client;
|
||||
|
|
Loading…
Reference in New Issue