From b8fabd59c0a9423f2f8ec10cd0f460721bc6fbb5 Mon Sep 17 00:00:00 2001 From: Eduwardo Horibe Date: Sat, 21 Oct 2023 15:26:55 -0300 Subject: [PATCH] Fixing NPE when showing a popup without an invoker on Windows 10 --- .../main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java index 013d86b78..fcba1f730 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java @@ -397,6 +397,10 @@ private static void resetWindows11Border( Window popupWindow ) { } private static boolean overlapsHeavyWeightComponent( Component owner, Component contents, int x, int y ) { + if( owner == null ) { + return false; + } + Window window = SwingUtilities.getWindowAncestor( owner ); if( window == null ) return false;