From cb3e8c2b4fa2edc6162ee6d569728cb914092d23 Mon Sep 17 00:00:00 2001 From: weisj Date: Wed, 5 Aug 2020 16:18:22 +0200 Subject: [PATCH] Check parent path isn't null. Fixes #203 --- .../weisj/darklaf/ui/cell/hint/CellHintPopupListener.java | 3 --- .../java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/cell/hint/CellHintPopupListener.java b/core/src/main/java/com/github/weisj/darklaf/ui/cell/hint/CellHintPopupListener.java index 638e04ba..15b52805 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/cell/hint/CellHintPopupListener.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/cell/hint/CellHintPopupListener.java @@ -115,9 +115,6 @@ public class CellHintPopupListener extends MouseInputAd cellBounds.y = rect.y - cellBounds.y; rect.x += popupLocation.x; rect.y += popupLocation.y; - System.out.println("Allocation " + allocation); - System.out.println("CellBounds " + cellBounds); - System.out.println("PreffeSize " + prefSize); enter(index, rect, cellBounds); return; } else { diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java index d84ef851..9016283c 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tree/DarkTreeUI.java @@ -600,7 +600,9 @@ public class DarkTreeUI extends BasicTreeUI implements PropertyChangeListener, C if (p == null) return false; if (Objects.equals(p, path)) return true; if (tree.isExpanded(p)) return false; - return Objects.equals(p.getParentPath().getLastPathComponent(), path.getLastPathComponent()); + TreePath parent = p.getParentPath(); + if (parent == null) return false; + return Objects.equals(parent.getLastPathComponent(), path.getLastPathComponent()); } protected boolean isDashedLine() {