You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by de...@apache.org on 2008/05/31 14:22:42 UTC

svn commit: r662019 - /xmlgraphics/batik/trunk/sources/org/apache/batik/swing/JSVGScrollPane.java

Author: deweese
Date: Sat May 31 05:22:42 2008
New Revision: 662019

URL: http://svn.apache.org/viewvc?rev=662019&view=rev
Log:
Added protection against null return from getViewBoxRect

Modified:
    xmlgraphics/batik/trunk/sources/org/apache/batik/swing/JSVGScrollPane.java

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/swing/JSVGScrollPane.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/swing/JSVGScrollPane.java?rev=662019&r1=662018&r2=662019&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/swing/JSVGScrollPane.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/swing/JSVGScrollPane.java Sat May 31 05:22:42 2008
@@ -393,6 +393,8 @@
             }
 
             Rectangle2D newview = getViewBoxRect();
+            if (newview == null) return;
+
             if ((newview.getX() != viewBox.getX()) ||
                 (newview.getY() != viewBox.getY()) ||
                 (newview.getWidth() != viewBox.getWidth()) ||
@@ -409,6 +411,8 @@
             }
 
             Rectangle2D newview = getViewBoxRect();
+            if (newview == null) return;
+
             if ((newview.getX() != viewBox.getX()) ||
                 (newview.getY() != viewBox.getY()) ||
                 (newview.getWidth() != viewBox.getWidth()) ||
@@ -581,7 +585,11 @@
     protected void checkAndSetViewBoxRect() {
         if (viewBox != null) return;
 
-        viewBox = getViewBoxRect();
+        Rectangle2D newview = getViewBoxRect();
+        if (newview == null) return;
+
+        viewBox = newview;
+
         // System.out.println("  ** viewBox rect set: "+viewBox);
         // System.out.println("  ** doc size: "+
         //                    canvas.getSVGDocumentSize());