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>
This commit is contained in:
Zhen Chen 2018-01-17 15:14:43 -08:00
parent f40ebed124
commit 5452ac1dea
1 changed files with 1 additions and 1 deletions

View File

@ -241,7 +241,7 @@ public Map<String, Ref> getRefs(String prefix) throws IOException {
: table.seekRef(prefix)) {
while (rc.next()) {
Ref ref = table.resolve(rc.getRef());
if (ref != null) {
if (ref != null && ref.getObjectId() != null) {
all.add(ref);
}
}