changeset 6498:10d656e22fbd

RT-36246: NPE on Node#localToScreen
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Mon, 17 Mar 2014 15:29:56 -0700
parents c66b3066b41e
children 2f2379857779
files modules/graphics/src/main/java/javafx/scene/Node.java
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/javafx/scene/Node.java	Mon Mar 17 12:21:28 2014 -0600
+++ b/modules/graphics/src/main/java/javafx/scene/Node.java	Mon Mar 17 15:29:56 2014 -0700
@@ -3947,10 +3947,10 @@
      */
     public Point2D screenToLocal(double screenX, double screenY) {
         Scene scene = getScene();
+        if (scene == null) return null;
         Window window = scene.getWindow();
-        if (scene == null || window == null) {
-            return null;
-        }
+        if (window == null) return null;
+
         final com.sun.javafx.geom.Point2D tempPt =
                 TempState.getInstance().point;
 
@@ -4159,10 +4159,9 @@
      */
     public Point2D localToScreen(double localX, double localY, double localZ) {
         Scene scene = getScene();
+        if (scene == null) return null;
         Window window = scene.getWindow();
-        if (scene == null || window == null) {
-            return null;
-        }
+        if (window == null) return null;
 
         Point3D pt = localToScene(localX, localY, localZ);
         final SubScene subScene = getSubScene();