Skip to content

Commit

Permalink
Test to throw exception if no parent
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarvelle committed Sep 13, 2023
1 parent 916f001 commit 34ff49f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ private Optional<DomainEntity> updateNodeConnection(NodeConnection nodeConnectio
nodeConnection.getParent().get().getPublicId());
Node child = nodeRepository.findByPublicId(
nodeConnection.getChild().get().getPublicId());
if (parent == null || child == null) {
throw new RuntimeException("Failed to find parent or child.");
}
existing = nodeConnectionRepository.findByParentIdAndChildId(parent.getId(), child.getId());
if (existing != null) {
existing.setPublicId(nodeConnection.getPublicId());
Expand Down

0 comments on commit 34ff49f

Please sign in to comment.