From af8f5db5554354ab77bb9b7e0f00b830ad59bbd2 Mon Sep 17 00:00:00 2001 From: Diego Ruiz <12065321+d-ruiz@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:45:57 +0200 Subject: [PATCH] IDEMPIERE-5887 - Fixed bug causing NPE when clicking on Flat View (#2063) --- .../adempiere/webui/panel/MenuTreeFilterPanel.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/MenuTreeFilterPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/MenuTreeFilterPanel.java index fe6620dc7e..325f9ae6cb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/MenuTreeFilterPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/MenuTreeFilterPanel.java @@ -254,12 +254,14 @@ public class MenuTreeFilterPanel extends Popup implements EventListener, else { Treeitem parent = treeItem.getParentItem(); - Treeitem sibling = (Treeitem) treeItem.getAttribute(ORIGINAL_SIBLING); - if (sibling != null) - { - reattachSibling(parent.getTreechildren(), sibling); + if (parent != null) { + Treeitem sibling = (Treeitem) treeItem.getAttribute(ORIGINAL_SIBLING); + if (sibling != null) + { + reattachSibling(parent.getTreechildren(), sibling); + } + parent.getTreechildren().insertBefore(treeItem, sibling); } - parent.getTreechildren().insertBefore(treeItem, sibling); } } }