IDEMPIERE-5887 - Fixed bug causing NPE when clicking on Flat View (#2063)

This commit is contained in:
Diego Ruiz 2023-10-17 16:45:57 +02:00 committed by GitHub
parent c91f1b6fb8
commit af8f5db555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -254,12 +254,14 @@ public class MenuTreeFilterPanel extends Popup implements EventListener<Event>,
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);
}
}
}