Skip to content

Commit

Permalink
Bugfix for referential integrity nullpointer
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Jan 17, 2025
1 parent 82c0967 commit ffdba85
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ private void doDeleteOrphans() {
List<Map<String, Object>> entries =
(List<Map<String, Object>>) metaData.getData().get(orphanMetaData.getReferencedCollectionName());

List<Map<String, Object>> newEntries = entries.stream().filter(entry -> !entry.get("name").equals
(orphanMetaData.getMissingEntityId())).collect(Collectors.toList());
List<Map<String, Object>> newEntries = entries.stream()
.filter(entry -> entry.get("name") != null &&
!entry.get("name").equals(orphanMetaData.getMissingEntityId()))
.toList();
metaData.getData().put(orphanMetaData.getReferencedCollectionName(), newEntries);
MetaData previous = metaDataRepository.findById(metaData.getId(), orphanMetaData.getCollection());
previous.revision(UUID.randomUUID().toString());
Expand Down

0 comments on commit ffdba85

Please sign in to comment.