Skip to content

Commit

Permalink
fix a copy-paste issue on a dead element
Browse files Browse the repository at this point in the history
  • Loading branch information
dbraquart committed Feb 22, 2024
1 parent 3b9d35a commit 652950d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,12 @@ public void createNetworkModifications(List<ElementAttributes> modificationAttri
// create all corresponding directory elements
modificationAttributesList.forEach(m -> {
final UUID newId = newModificationsUuids.get(m.getElementUuid());
ElementAttributes elementAttributes = new ElementAttributes(newId, m.getElementName(), MODIFICATION,
null, userId, 0L, m.getDescription());
directoryService.createElementWithNewName(elementAttributes, parentDirectoryUuid, userId, true);
if (newId != null) {
// an Id may be null if a duplication could not succeed (ex: we provide a bad uuid)
ElementAttributes elementAttributes = new ElementAttributes(newId, m.getElementName(), MODIFICATION,
null, userId, 0L, m.getDescription());
directoryService.createElementWithNewName(elementAttributes, parentDirectoryUuid, userId, true);
}
});
}
}

0 comments on commit 652950d

Please sign in to comment.