]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
makes checks to prevent exceptions
authorKeiron Liddle <keiron@apache.org>
Fri, 23 Feb 2001 03:47:08 +0000 (03:47 +0000)
committerKeiron Liddle <keiron@apache.org>
Fri, 23 Feb 2001 03:47:08 +0000 (03:47 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194084 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/dom/svg/SVGDocumentImpl.java
src/org/apache/fop/fo/FObj.java

index 70be48f481d30909447a9ef30c9391657bb3c7cc..66e6135075051b52c15759f8d445b8516d2f7299 100644 (file)
@@ -102,7 +102,9 @@ public class SVGDocumentImpl extends ElementImpl implements SVGDocument {
 
        public SVGSVGElement getRootElement()
        {
-               return (SVGSVGElement)childs.elementAt(0);
+               if(childs.size() > 0)
+               return (SVGSVGElement)childs.elementAt(0);
+       return null;
        }
 
        public Element getElementById(String elementId)
index cd3746a84cb9f6fa2d2c2f857f2bc88eed9106f0..2011ef1409f430eebae47a395ab8e9191d6be8af 100644 (file)
@@ -165,6 +165,8 @@ public class FObj extends FONode {
    */
   public void removeID(IDReferences idReferences)
   {
+      if(((FObj)this).properties.get("id") == null)
+          return;
       idReferences.removeID( ((FObj)this).properties.get("id").getString());                            
       int numChildren = this.children.size();
     for (int i = 0; i < numChildren; i++)