diff --git a/CHANGELOG.md b/CHANGELOG.md index 08e88ec8e..e6f1e3fa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ FlatLaf Change Log feedback only for left mouse button. - ScaledImageIcon: Do not throw exceptions if image was has invalid size (e.g. not found). Instead, paint a red rectangle (similar to `FlatSVGIcon`). +- Fixed NPE in `FlatUIUtils.isCellEditor()`. (issue #601) ## 2.5 diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java index f0dcd89dd..0da580534 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java @@ -210,6 +210,9 @@ public static int minimumHeight( JComponent c, int minimumHeight ) { } public static boolean isCellEditor( Component c ) { + if( c == null ) + return false; + // check whether used in cell editor (check 3 levels up) Component c2 = c; for( int i = 0; i <= 2 && c2 != null; i++ ) {