changeset 5610:b28bd41e9b56

RT-33387 WebView NPE
author peterz
date Fri, 01 Nov 2013 12:44:17 +0400
parents c88c0f08efa2
children 6af0f4099136
files modules/web/src/main/java/com/sun/javafx/webkit/prism/RTImage.java modules/web/src/main/java/com/sun/javafx/webkit/prism/WCGraphicsPrismContext.java modules/web/src/main/java/com/sun/webkit/graphics/WCRenderQueue.java
diffstat 3 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/modules/web/src/main/java/com/sun/javafx/webkit/prism/RTImage.java	Thu Oct 31 16:03:16 2013 -0700
+++ b/modules/web/src/main/java/com/sun/javafx/webkit/prism/RTImage.java	Fri Nov 01 12:44:17 2013 +0400
@@ -70,6 +70,9 @@
             int dstx1, int dsty1, int dstx2, int dsty2,
             int srcx1, int srcy1, int srcx2, int srcy2)
     {
+        if (txt == null) {
+            return;
+        }
         if (g instanceof PrinterGraphics) {
             // We're printing. Copy [txt] into a J2DTexture and draw it.
             int w = srcx2 - srcx1;
--- a/modules/web/src/main/java/com/sun/javafx/webkit/prism/WCGraphicsPrismContext.java	Thu Oct 31 16:03:16 2013 -0700
+++ b/modules/web/src/main/java/com/sun/javafx/webkit/prism/WCGraphicsPrismContext.java	Fri Nov 01 12:44:17 2013 +0400
@@ -1579,8 +1579,7 @@
 
     public void dispose() {
         if (!states.isEmpty()) {
-            new IllegalStateException("Unbalanced saveState/restoreState")
-                    .printStackTrace();
+            log.fine("Unbalanced saveState/restoreState");
         }
         while (!states.isEmpty()) {
             restoreStateInternal();
--- a/modules/web/src/main/java/com/sun/webkit/graphics/WCRenderQueue.java	Thu Oct 31 16:03:16 2013 -0700
+++ b/modules/web/src/main/java/com/sun/webkit/graphics/WCRenderQueue.java	Fri Nov 01 12:44:17 2013 +0400
@@ -69,7 +69,7 @@
                 GraphicsDecoder.decode(
                     WCGraphicsManager.getGraphicsManager(), gc, bdata);
             } catch (RuntimeException e) {
-                e.printStackTrace();
+                log.fine("Exception occurred: " + e);
             }
         }
         dispose();