From d31a64c6e9a74097cc7817daf447d3e6d3906b60 Mon Sep 17 00:00:00 2001 From: weisj Date: Fri, 25 Oct 2019 20:23:45 +0200 Subject: [PATCH] Fixed NPE when no TabFrameParent was set for PanelPopup. Signed-off-by: weisj --- .../github/weisj/darklaf/ui/tabframe/DarkPanelPopupUI.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkPanelPopupUI.java b/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkPanelPopupUI.java index e713ea37..fcc19bb8 100644 --- a/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkPanelPopupUI.java +++ b/src/main/java/com/github/weisj/darklaf/ui/tabframe/DarkPanelPopupUI.java @@ -358,8 +358,10 @@ public class DarkPanelPopupUI extends DarkPanelUI implements PropertyChangeListe if (focusOwner instanceof JTabFrame) return; if (focusOwner instanceof JRootPane) return; boolean focus = DarkUIUtil.hasFocus(popupComponent); - var container = popupComponent.getTabFrame().getContentPane().getContainer(popupComponent.getAlignment()); - focus = focus || DarkUIUtil.hasFocus(container); + if (popupComponent.getTabFrame() != null) { + var container = popupComponent.getTabFrame().getContentPane().getContainer(popupComponent.getAlignment()); + focus = focus || DarkUIUtil.hasFocus(container); + } setHeaderBackground(focus); } }