Skip to content
Permalink
Browse files
OAK-9700: RevisionGC may fail with NPE
Log debug message when id is null as suggested by Stefan Egli
  • Loading branch information
mreutegg committed Feb 22, 2022
1 parent e9cf5a6 commit 64c0bd4268bb651d7e0dd432ecdfabed454c4138
Showing 1 changed file with 5 additions and 2 deletions.
@@ -680,7 +680,7 @@ boolean possiblyDeleted(NodeDocument doc)
addLeafDocument(id);
} else {
addDocument(id);
addPreviousDocuments(previousDocs);
addPreviousDocuments(previousDocs, doc.getId());
}
return true;
} else {
@@ -803,11 +803,14 @@ private long getNumPreviousDocuments() {
return prevDocIdsToDelete.getSize() - exclude.size();
}

private void addPreviousDocuments(Iterator<String> ids) throws IOException {
private void addPreviousDocuments(Iterator<String> ids,
String mainDocId) throws IOException {
while (ids.hasNext()) {
String id = ids.next();
if (id != null) {
prevDocIdsToDelete.add(id);
} else {
log.debug("addPreviousDocuments: null id found via mainDocId={}", mainDocId);
}
}
}

0 comments on commit 64c0bd4

Please sign in to comment.