From 3ed9773a44ef3f976906702e42bc85e0d0db3aa6 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 26 Oct 2020 16:42:58 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-41299=20=E6=96=B0=E5=BB=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=95=B0=E6=8D=AE=E9=9B=86=E6=97=A0=E6=B3=95=E5=88=A0?= =?UTF-8?q?=E9=99=A4-=E8=BD=ACmeiao=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91=E5=A6=82=E6=9E=9C=E5=BB=BA=E7=AB=8B=E4=BA=86?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E6=95=B0=E6=8D=AE=E9=9B=86=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E5=B0=86=E6=95=B0=E6=8D=AE=E9=9B=86=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=88=97=E5=90=8D=E6=97=B6=EF=BC=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=85=B6=E4=B8=AD=E4=B8=80=E4=B8=AA=E4=BC=9A=E9=80=A0?= =?UTF-8?q?=E6=88=90cTreeNode.getFirstChild()=E4=BA=A7=E7=94=9F=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=EF=BC=8C=E4=BB=8E=E8=80=8C=E4=B8=8D=E8=83=BD=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=95=8C=E9=9D=A2=EF=BC=8C=E7=9C=8B=E8=B5=B7=E6=9D=A5?= =?UTF-8?q?=E5=B0=B1=E6=98=AF=E5=88=A0=E9=99=A4=E4=B8=8D=E6=8E=89=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=88=A4=E6=96=ADcTreeNode=E6=98=AF=E5=90=A6=E6=98=AF?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=95=B0=E6=8D=AE=E9=9B=86=E5=B9=B6=E5=A4=84?= =?UTF-8?q?=E4=BA=8E=E5=B1=95=E5=BC=80=E7=8A=B6=E6=80=81=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E6=98=AF=E7=9A=84=EF=BC=8C=E5=B0=86=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=BD=AE=E4=B8=BA=E4=B8=8D=E5=B1=95=E5=BC=80?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6break=E8=B7=B3=E8=BF=87=E5=90=8E=E9=9D=A2?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=AD=90=E8=8A=82=E7=82=B9=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E9=81=BF=E5=85=8D=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/datapane/TableDataTree.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 8f49b6e504..3feabeac13 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 +}