diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java index 8f49b6e50..3feabeac1 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java @@ -118,6 +118,11 @@ public class TableDataTree extends UserObjectRefreshJTree { break; } new_nodes[ci].setExpanded(cTreeNode.isExpanded()); + // REPORT-41299 如果建立的是错误的数据集(没有Child的情况)且这个错误数据集处于isExpanded状态,会在后面的if语句中调用getFirstChild()产生异常,因此这里判断一下 + if (cTreeNode.isExpanded() && cTreeNode.getChildCount() == 0) { + new_nodes[ci].setExpanded(false); + break; + } if (cTreeNode.getFirstChild() instanceof ExpandMutableTreeNode && cTreeNode.isExpanded()) { checkChildNodes(cTreeNode, new_nodes[ci]); } @@ -247,4 +252,4 @@ public class TableDataTree extends UserObjectRefreshJTree { treeModel.reload(root); } -} \ No newline at end of file +}