changeset 11235:bdf63f7632c1

8221987: NPE in javafx.graphics/javafx.stage.Window$TKBoundsConfigurator.apply Reviewed-by: kcr, arapte Contributed-by: christian.heilmann@zeiss.com
author arapte
date Tue, 16 Apr 2019 14:11:19 +0530
parents aace3d512963
children b1b8c9c65c2a
files modules/javafx.graphics/src/main/java/javafx/stage/Window.java
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/modules/javafx.graphics/src/main/java/javafx/stage/Window.java	Sat Apr 13 06:34:33 2019 -0700
+++ b/modules/javafx.graphics/src/main/java/javafx/stage/Window.java	Tue Apr 16 14:11:19 2019 +0530
@@ -1531,6 +1531,10 @@
 
         public void apply() {
             if (dirty) {
+                if (peer == null) {
+                    reset();
+                    return;
+                }
                 // Snapshot values and then reset() before we call down
                 // as we may end up with recursive calls back up with
                 // new values that must be recorded as dirty.
@@ -1548,9 +1552,9 @@
                 float newRY = (float) renderScaleY;
                 reset();
                 peer.setBounds(newX, newY, xSet, ySet,
-                                    newWW, newWH, newCW, newCH,
-                                    newXG, newYG,
-                                    newRX, newRY);
+                        newWW, newWH, newCW, newCH,
+                        newXG, newYG,
+                        newRX, newRY);
             }
         }