Skip to content

Commit 77c3bc8

Browse files
committed
WIP: add missing null check
1 parent d7f7484 commit 77c3bc8

File tree

1 file changed

+2
-1
lines changed
  • src/main/java/com/flowingcode/vaadin/addons/orgchart

1 file changed

+2
-1
lines changed

src/main/java/com/flowingcode/vaadin/addons/orgchart/OrgChart.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,8 @@ protected void fireSiblingsAddedEvent(OrgChartItem item, List<OrgChartItem> newS
483483
public void addChildren(Integer nodeId, List<OrgChartItem> children) {
484484
// Update the internal data structure
485485
OrgChartItem targetNode = getById(nodeId, orgChartItem);
486-
boolean currentChildrenEmpty = targetNode.getChildren().isEmpty();
486+
boolean currentChildrenEmpty =
487+
targetNode.getChildren() == null || targetNode.getChildren().isEmpty();
487488
if (targetNode != null) {
488489
// Add new children while preserving existing ones
489490
appendItemsToParent(targetNode, children);

0 commit comments

Comments
 (0)