Skip to content

Commit 8759ff9

Browse files
committed
fix #924 TreeGrid expand all crashes
1 parent cd52a72 commit 8759ff9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

domino-ui/src/main/java/org/dominokit/domino/ui/datatable/plugins/tree/TreeGridPlugin.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,11 @@ private void expand(TableRow<T> row, boolean recursive) {
335335
Optional<TreeGridRowToggleIcon> iconMeta = row.getMeta(TREE_GRID_ROW_TOGGLE_ICON);
336336
iconMeta.ifPresent(
337337
meta -> {
338-
ToggleIcon<?, ?> icon = Js.uncheckedCast(meta.icon);
339-
if (!icon.isToggled()) {
340-
icon.toggle();
338+
if (!row.getChildren().isEmpty()) {
339+
ToggleIcon<?, ?> icon = Js.uncheckedCast(meta.icon);
340+
if (!icon.isToggled()) {
341+
icon.toggle();
342+
}
341343
}
342344
});
343345
}
@@ -355,8 +357,6 @@ private void showRow(TableRow<T> row) {
355357
* Collapses a specific TableRow, hiding it, and optionally collapsing its child rows recursively.
356358
*
357359
* @param row The TableRow to collapse.
358-
* @param recursive If true, child rows are collapsed recursively; otherwise, only the direct
359-
* child rows are collapsed.
360360
*/
361361
private void collapse(TableRow<T> row) {
362362
this.dataTable.fireTableEvent(new TreeRowOnBeforeCollapseEvent<>(row));

0 commit comments

Comments
 (0)