Popup: fixed potential NPE in (unusual) case that the popup invoker is null (only on Linux with Wayland and Java 21; regression in 3.2.3) (issue #752)

This commit is contained in:
Karl Tauber
2023-10-21 18:21:59 +02:00
parent 13a418f74e
commit 2a237ff5fc
2 changed files with 9 additions and 1 deletions

View File

@@ -1,6 +1,14 @@
FlatLaf Change Log
==================
## 3.2.4
#### Fixed bugs
- Popup: Fixed potential NPE in (unusual) case that the popup invoker is `null`
(only on Linux with Wayland and Java 21; regression in 3.2.3). (issue #752)
## 3.2.3
#### Fixed bugs

View File

@@ -438,7 +438,7 @@ public class FlatPopupFactory
*/
private static void fixLinuxWaylandJava21focusIssue( Component owner ) {
// only necessary on Linux when running in Java 21+
if( !SystemInfo.isLinux || SystemInfo.javaVersion < SystemInfo.toVersion( 21, 0, 0, 0 ) )
if( owner == null || !SystemInfo.isLinux || SystemInfo.javaVersion < SystemInfo.toVersion( 21, 0, 0, 0 ) )
return;
// get window