Skip to content

Commit

Permalink
'#39: fix a NPE when dragging node with right mouse button
Browse files Browse the repository at this point in the history
  • Loading branch information
lfcnassif authored and patrickdalla committed Jul 1, 2024
1 parent bb92776 commit 9ad56bc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions iped-app/src/main/java/iped/app/ui/FiltersPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,12 @@ public void itemStateChanged(ItemEvent e) {

filtersTree.addMouseListener(new MouseAdapter() {
public void showPopupMenu(MouseEvent e) {
Object o = filtersTree.getPathForLocation(e.getX(), e.getY()).getLastPathComponent();
filtererMenu.setContext(o);
filtererMenu.show((JComponent) e.getSource(), e.getX(), e.getY());
TreePath tp = filtersTree.getPathForLocation(e.getX(), e.getY());
if (tp != null) {
Object o = tp.getLastPathComponent();
filtererMenu.setContext(o);
filtererMenu.show((JComponent) e.getSource(), e.getX(), e.getY());
}
}

@Override
Expand Down

0 comments on commit 9ad56bc

Please sign in to comment.