Skip to content

Commit 9fae997

Browse files
committed
fix: fix nullpointer on program start - ui scale (#2720)
1 parent 61a842b commit 9fae997

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/com/jpexs/decompiler/flash/gui/Main.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2972,15 +2972,17 @@ private static void initGui() {
29722972
System.setProperty("sun.java2d.noddraw", "true");
29732973

29742974
if (System.getProperty("sun.java2d.uiScale") == null) { //it was not set by commandline, etc.
2975-
double scaleToUse = Configuration.uiScale.get();
2976-
if (!Configuration.uiScale.hasValue() || Configuration.uiScale.get() == null) {
2975+
Double scaleToUse = Configuration.uiScale.get();
2976+
if (scaleToUse == null || !Configuration.uiScale.hasValue()) {
29772977
// Auto-detect from current screen. Do NOT persist to config so the scale is
29782978
// re-detected on each launch (prevents stale 4K scale being applied on a
29792979
// lower-DPI monitor after a display change).
29802980
GraphicsConfiguration configuration = View.getMainDefaultScreenDevice().getDefaultConfiguration();
29812981
AffineTransform transform = configuration.getDefaultTransform();
29822982
if (transform != null) {
29832983
scaleToUse = transform.getScaleX();
2984+
} else {
2985+
scaleToUse = 1.0;
29842986
}
29852987
}
29862988
System.setProperty("sun.java2d.uiScale", "" + scaleToUse);

0 commit comments

Comments
 (0)