FlatButtonUI.getPreferredSize fix nullPointer when button.getComponentCount()>0

This commit is contained in:
mmatessi
2020-02-21 10:32:25 +01:00
parent fee00b2acb
commit c0f2784599

View File

@@ -398,7 +398,9 @@ public class FlatButtonUI
if( isHelpButton( c ) )
return new Dimension( helpButtonIcon.getIconWidth(), helpButtonIcon.getIconHeight() );
Dimension prefSize = super.getPreferredSize( c );
Dimension prefSize = super.getPreferredSize(c);
if ( prefSize == null )
return null;
// make button square if it is a icon-only button
// or apply minimum width, if not in toolbar and not a icon-only button