mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 15:00:54 +03:00
FlatEmptyBorder: fixed possible NPE if passed component is null
This commit is contained in:
@@ -56,7 +56,7 @@ public class FlatEmptyBorder
|
|||||||
protected static Insets scaleInsets( Component c, Insets insets,
|
protected static Insets scaleInsets( Component c, Insets insets,
|
||||||
int top, int left, int bottom, int right )
|
int top, int left, int bottom, int right )
|
||||||
{
|
{
|
||||||
boolean leftToRight = left == right || c.getComponentOrientation().isLeftToRight();
|
boolean leftToRight = left == right || c == null || c.getComponentOrientation().isLeftToRight();
|
||||||
insets.left = scale( leftToRight ? left : right );
|
insets.left = scale( leftToRight ? left : right );
|
||||||
insets.top = scale( top );
|
insets.top = scale( top );
|
||||||
insets.right = scale( leftToRight ? right : left );
|
insets.right = scale( leftToRight ? right : left );
|
||||||
|
|||||||
Reference in New Issue
Block a user