diff options
author | Minh Thai <mthai@google.com> | 2023-09-06 07:13:05 -0700 |
---|---|---|
committer | Minh Thai <mthai@google.com> | 2023-09-06 07:13:05 -0700 |
commit | ba1653162c4dba3a25a600bef642dc5459ce01ee (patch) | |
tree | 5ca96b4b7f6863f4d94244cd1a43a8ecad693dc5 /org.eclipse.jgit.ssh.apache/src | |
parent | f90f0717a0abe08a58dd92c9b05d3f6c7144d3d9 (diff) | |
download | jgit-ba1653162c4dba3a25a600bef642dc5459ce01ee.tar.gz 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/src')
-rw-r--r-- | org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSessionFactory.java | 10 |
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; |