mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 14:30:56 +03:00
PopupFactory: fixed NPE on Windows 10 when owner is null (issue #952)
This commit is contained in:
@@ -18,6 +18,7 @@ FlatLaf Change Log
|
|||||||
|
|
||||||
- FileChooser: Improved performance when navigating to large directories with
|
- FileChooser: Improved performance when navigating to large directories with
|
||||||
thousands of files. (issue #953)
|
thousands of files. (issue #953)
|
||||||
|
- PopupFactory: Fixed NPE on Windows 10 when `owner` is `null`. (issue #952)
|
||||||
|
|
||||||
|
|
||||||
## 3.5.4
|
## 3.5.4
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ public class FlatPopupFactory
|
|||||||
|
|
||||||
// create drop shadow popup
|
// create drop shadow popup
|
||||||
Popup popupForScreenOfOwner = getPopupForScreenOfOwner( owner, contents, x, y, forceHeavyWeight );
|
Popup popupForScreenOfOwner = getPopupForScreenOfOwner( owner, contents, x, y, forceHeavyWeight );
|
||||||
GraphicsConfiguration gc = owner.getGraphicsConfiguration();
|
GraphicsConfiguration gc = (owner != null) ? owner.getGraphicsConfiguration() : null;
|
||||||
return (gc != null && gc.isTranslucencyCapable())
|
return (gc != null && gc.isTranslucencyCapable())
|
||||||
? new DropShadowPopup( popupForScreenOfOwner, owner, contents )
|
? new DropShadowPopup( popupForScreenOfOwner, owner, contents )
|
||||||
: new NonFlashingPopup( popupForScreenOfOwner, owner, contents );
|
: new NonFlashingPopup( popupForScreenOfOwner, owner, contents );
|
||||||
@@ -306,7 +306,7 @@ public class FlatPopupFactory
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( gc == null )
|
if( gc == null && owner != null )
|
||||||
gc = owner.getGraphicsConfiguration();
|
gc = owner.getGraphicsConfiguration();
|
||||||
if( gc == null )
|
if( gc == null )
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user