UIScale: fixed NPE in getSystemScaleFactor() (occurred in progress bar on startup in NB)

This commit is contained in:
Karl Tauber
2020-03-16 22:46:33 +01:00
parent 2608061d48
commit c706a79f74

View File

@@ -97,7 +97,7 @@ public class UIScale
} }
public static double getSystemScaleFactor( GraphicsConfiguration gc ) { public static double getSystemScaleFactor( GraphicsConfiguration gc ) {
return isSystemScalingEnabled() ? gc.getDefaultTransform().getScaleX() : 1; return (isSystemScalingEnabled() && gc != null) ? gc.getDefaultTransform().getScaleX() : 1;
} }
//---- user scaling (Java 8) ---------------------------------------------- //---- user scaling (Java 8) ----------------------------------------------