Browse Source

[infer] Fix potential NPE in DiffFormatter

Change-Id: Ia33e2af9ce3393d9173ca0dc7efefd86c965d8c8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.7
Matthias Sohn 8 years ago
parent
commit
b686c8468c
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java

2
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java

@ -682,7 +682,7 @@ public class DiffFormatter implements AutoCloseable {
} }
private static byte[] writeGitLinkText(AbbreviatedObjectId id) { private static byte[] writeGitLinkText(AbbreviatedObjectId id) {
if (id.toObjectId().equals(ObjectId.zeroId())) { if (ObjectId.zeroId().equals(id.toObjectId())) {
return EMPTY; return EMPTY;
} }
return encodeASCII("Subproject commit " + id.name() //$NON-NLS-1$ return encodeASCII("Subproject commit " + id.name() //$NON-NLS-1$

Loading…
Cancel
Save