diff --git a/CHANGELOG.md b/CHANGELOG.md index 27e020a4..ff72f13f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ FlatLaf Change Log - FileChooser: Improved performance when navigating to large directories with thousands of files. (issue #953) +- PopupFactory: Fixed NPE on Windows 10 when `owner` is `null`. (issue #952) ## 3.5.4 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 c5621132..7ab53ece 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 @@ -138,7 +138,7 @@ public class FlatPopupFactory // create drop shadow popup Popup popupForScreenOfOwner = getPopupForScreenOfOwner( owner, contents, x, y, forceHeavyWeight ); - GraphicsConfiguration gc = owner.getGraphicsConfiguration(); + GraphicsConfiguration gc = (owner != null) ? owner.getGraphicsConfiguration() : null; return (gc != null && gc.isTranslucencyCapable()) ? new DropShadowPopup( popupForScreenOfOwner, owner, contents ) : new NonFlashingPopup( popupForScreenOfOwner, owner, contents ); @@ -306,7 +306,7 @@ public class FlatPopupFactory break; } } - if( gc == null ) + if( gc == null && owner != null ) gc = owner.getGraphicsConfiguration(); if( gc == null ) return null;