]> source.dussan.org Git - jgit.git/commit
ssh: Remove redundant null check for home.getAbsoluteFile() 67/204267/1
authorJonathan Nieder <jrn@google.com>
Tue, 12 Sep 2023 00:12:17 +0000 (17:12 -0700)
committerJonathan Nieder <jrn@google.com>
Tue, 12 Sep 2023 00:12:17 +0000 (17:12 -0700)
commit3bc1da30dfb11a2cdfc0efb5bcc62af09be9cfd9
tree162b2267d19af15126f672caca40c36933598fa1
parent82c6638c72cd9525bab94b02438c167747132be9
ssh: Remove redundant null check for home.getAbsoluteFile()

File#getAbsoluteFile is non-nullable, so this check can never trigger.
Worse, getAbsoluteFile can throw an exception such as
InvalidPathException, and since this call isn't in the "try" block
that checks for that, the exception would then escape the getSession
call.

Noticed because the exception is being thrown in googlesource.com's
custom SshdSessionFactory, causing incoming ssh requests to fail
(noticed using internal tests).

Change-Id: I57f2d5e497ff678b17573f79827b6e1d9a6c9b9f
Signed-off-by: Jonathan Nieder <jrn@google.com>
org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSessionFactory.java