mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
List and Table: fixed possible NPE in unusual cases
This commit is contained in:
@@ -126,6 +126,9 @@ public class FlatListUI
|
||||
* or the application has to be changed to extend a FlatLaf renderer.
|
||||
*/
|
||||
private void toggleSelectionColors() {
|
||||
if( list == null )
|
||||
return;
|
||||
|
||||
if( FlatUIUtils.isPermanentFocusOwner( list ) ) {
|
||||
if( list.getSelectionBackground() == selectionInactiveBackground )
|
||||
list.setSelectionBackground( selectionBackground );
|
||||
|
||||
@@ -188,6 +188,9 @@ public class FlatTableUI
|
||||
* or the application has to be changed to extend a FlatLaf renderer.
|
||||
*/
|
||||
private void toggleSelectionColors() {
|
||||
if( table == null )
|
||||
return;
|
||||
|
||||
if( FlatUIUtils.isPermanentFocusOwner( table ) ) {
|
||||
if( table.getSelectionBackground() == selectionInactiveBackground )
|
||||
table.setSelectionBackground( selectionBackground );
|
||||
|
||||
Reference in New Issue
Block a user