Browse Source

Skip broken symbolic ref in DfsReftableDatabase

We skipped the broken symbolic reference in other implementation like
DfsRefDatabase, RefDirectory. The broken symbolic reference may cause
NPE when caller forget to have a null check against the object id before
calling parse it.

Change-Id: If5e07202e9ee329d0bd9488936d79c98143c7ad9
Signed-off-by: Zhen Chen <czhen@google.com>
tags/v4.11.0.201803080745-r
Zhen Chen 6 years ago
parent
commit
5452ac1dea

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReftableDatabase.java View File

@@ -241,7 +241,7 @@ public class DfsReftableDatabase extends DfsRefDatabase {
: table.seekRef(prefix)) {
while (rc.next()) {
Ref ref = table.resolve(rc.getRef());
if (ref != null) {
if (ref != null && ref.getObjectId() != null) {
all.add(ref);
}
}

Loading…
Cancel
Save