Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMinh Thai2023-09-06 14:13:05 +0000
committerMinh Thai2023-09-06 14:13:05 +0000
commitba1653162c4dba3a25a600bef642dc5459ce01ee (patch)
tree5ca96b4b7f6863f4d94244cd1a43a8ecad693dc5 /org.eclipse.jgit.ssh.apache
parentf90f0717a0abe08a58dd92c9b05d3f6c7144d3d9 (diff)
downloadjgit-ba1653162c4dba3a25a600bef642dc5459ce01ee.tar.gz
jgit-ba1653162c4dba3a25a600bef642dc5459ce01ee.tar.xz
jgit-ba1653162c4dba3a25a600bef642dc5459ce01ee.zip
Ensure home directory not null before using in Sshdsessionfactory
Home directory might not be set in DFS. Change-Id: I3528685838065dc291826fc73a37126af7bf47ce
Diffstat (limited to 'org.eclipse.jgit.ssh.apache')
-rw-r--r--org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSessionFactory.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSessionFactory.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSessionFactory.java
index 35c9be047a..cb2549e900 100644
--- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSessionFactory.java
+++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSessionFactory.java
@@ -244,11 +244,13 @@ public class SshdSessionFactory extends SshSessionFactory implements Closeable {
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;

Back to the top