mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 22:10:54 +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.
|
* or the application has to be changed to extend a FlatLaf renderer.
|
||||||
*/
|
*/
|
||||||
private void toggleSelectionColors() {
|
private void toggleSelectionColors() {
|
||||||
|
if( list == null )
|
||||||
|
return;
|
||||||
|
|
||||||
if( FlatUIUtils.isPermanentFocusOwner( list ) ) {
|
if( FlatUIUtils.isPermanentFocusOwner( list ) ) {
|
||||||
if( list.getSelectionBackground() == selectionInactiveBackground )
|
if( list.getSelectionBackground() == selectionInactiveBackground )
|
||||||
list.setSelectionBackground( selectionBackground );
|
list.setSelectionBackground( selectionBackground );
|
||||||
|
|||||||
@@ -188,6 +188,9 @@ public class FlatTableUI
|
|||||||
* or the application has to be changed to extend a FlatLaf renderer.
|
* or the application has to be changed to extend a FlatLaf renderer.
|
||||||
*/
|
*/
|
||||||
private void toggleSelectionColors() {
|
private void toggleSelectionColors() {
|
||||||
|
if( table == null )
|
||||||
|
return;
|
||||||
|
|
||||||
if( FlatUIUtils.isPermanentFocusOwner( table ) ) {
|
if( FlatUIUtils.isPermanentFocusOwner( table ) ) {
|
||||||
if( table.getSelectionBackground() == selectionInactiveBackground )
|
if( table.getSelectionBackground() == selectionInactiveBackground )
|
||||||
table.setSelectionBackground( selectionBackground );
|
table.setSelectionBackground( selectionBackground );
|
||||||
|
|||||||
Reference in New Issue
Block a user