]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
fixes npe when rendering, checks the correct length thing for val
authorKeiron Liddle <keiron@apache.org>
Fri, 3 Nov 2000 05:16:12 +0000 (05:16 +0000)
committerKeiron Liddle <keiron@apache.org>
Fri, 3 Nov 2000 05:16:12 +0000 (05:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193743 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/svg/SVG.java

index 4ecc8587a6e172c08424142df23c22a17ed17b7c..99df234ce9f0f97a7effcc819d8a6642db9b658d 100644 (file)
@@ -120,22 +120,26 @@ public class SVG extends FObj implements GraphicsCreator {
                       getSVGLength();
         svgArea = new SVGSVGElementImpl();
         SVGAnimatedLength sal;
+        if (w == null)
+            w = new SVGLengthImpl();
         sal = new SVGAnimatedLengthImpl(w);
         sal.setBaseVal(w);
         svgArea.setWidth(sal);
+        if (h == null)
+            h = new SVGLengthImpl();
         sal = new SVGAnimatedLengthImpl(h);
         sal.setBaseVal(h);
         svgArea.setHeight(sal);
-        SVGLengthProperty lengthProp =
-          (SVGLengthProperty) this.properties.get("x");
-        SVGLength x = lengthProp == null ? new SVGLengthImpl() :
-                      lengthProp.getSVGLength();
+        SVGLength lengthProp =
+          ((SVGLengthProperty) this.properties.get("x")).
+          getSVGLength();
+        SVGLength x = lengthProp == null ? new SVGLengthImpl() : lengthProp;
         sal = new SVGAnimatedLengthImpl(x);
         sal.setBaseVal(x);
         svgArea.setX(sal);
-        lengthProp = (SVGLengthProperty) this.properties.get("y");
-        SVGLength y = lengthProp == null ? new SVGLengthImpl() :
-                      lengthProp.getSVGLength();
+        lengthProp = ((SVGLengthProperty) this.properties.get("y")).
+                     getSVGLength();
+        SVGLength y = lengthProp == null ? new SVGLengthImpl() : lengthProp;
         sal = new SVGAnimatedLengthImpl(y);
         sal.setBaseVal(y);
         svgArea.setY(sal);