]> source.dussan.org Git - jgit.git/commit
[spotbugs] Fix potential NPE in OpenSshServerKeyDatabase 26/173426/6
authorMatthias Sohn <matthias.sohn@sap.com>
Fri, 4 Dec 2020 23:23:15 +0000 (00:23 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 22 Dec 2020 09:53:00 +0000 (10:53 +0100)
commit50f0347ea3a17aa754dfb139acfc2d57ea488fa4
tree2c2e7b4d50e3d9bd807e4d968af1e131e5128d42
parentbceb202319b6f2b02b15f32db5c40a912e4bd1f3
[spotbugs] Fix potential NPE in OpenSshServerKeyDatabase

If oldLine is null #updateModifiedServerKey shouldn't be called since it
would derefence it. Spotbugs raised this as problem
RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE. Fix it by checking if
oldLine is null before calling #updateModifiedServerKey.

Change-Id: I8a2000492986e52ce7dbe25f48b321c05fd371e4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyDatabase.java