Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ public synchronized void onDelete(R resource) {
primaryResources.forEach(
primaryResource -> {
var secondaryResources = index.get(primaryResource);
secondaryResources.remove(ResourceID.fromResource(resource));
if (secondaryResources.isEmpty()) {
index.remove(primaryResource);
// this can be null in just very special cases, like when the secondaryToPrimaryMapper is
// changing dynamically. Like if a list of ResourceIDs mapped dynamically extended in the
// mapper between the onAddOrUpdate and onDelete is called.
if (secondaryResources != null) {
secondaryResources.remove(ResourceID.fromResource(resource));
if (secondaryResources.isEmpty()) {
index.remove(primaryResource);
}
}
});
}
Expand Down