Skip to content

Commit

Permalink
Fix sonar issues
Browse files Browse the repository at this point in the history
RISDEV-0000
  • Loading branch information
HPrinz committed Nov 26, 2024
1 parent acb6a26 commit ff2fd96
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,12 @@ private void deleteDocUnitLinksForDeletedReferences(LegalPeriodicalEdition updat
for (UUID reference : oldEdition.get().getReferences()) {
// skip all existing and null references
var referenceDTO = referenceRepository.findById(reference);
if (updatedEdition.references().stream()
.anyMatch(
newReference -> newReference.id().equals(reference) || referenceDTO.isEmpty())) {
if (referenceDTO.isEmpty()
|| updatedEdition.references().stream()
.anyMatch(newReference -> newReference.id().equals(reference))) {
continue;
}

// delete all deleted references and possible source reference
documentationUnitRepository
.findById(referenceDTO.get().getDocumentationUnit().getId())
Expand Down

0 comments on commit ff2fd96

Please sign in to comment.