From: Keiron Liddle Date: Fri, 23 Feb 2001 03:47:08 +0000 (+0000) Subject: makes checks to prevent exceptions X-Git-Tag: fop-0_18_1~94 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0d26b9e73912dc202b4bbaeba502064a288715ee;p=xmlgraphics-fop.git makes checks to prevent exceptions git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194084 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/org/apache/fop/dom/svg/SVGDocumentImpl.java b/src/org/apache/fop/dom/svg/SVGDocumentImpl.java index 70be48f48..66e613507 100644 --- a/src/org/apache/fop/dom/svg/SVGDocumentImpl.java +++ b/src/org/apache/fop/dom/svg/SVGDocumentImpl.java @@ -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) diff --git a/src/org/apache/fop/fo/FObj.java b/src/org/apache/fop/fo/FObj.java index cd3746a84..2011ef140 100644 --- a/src/org/apache/fop/fo/FObj.java +++ b/src/org/apache/fop/fo/FObj.java @@ -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++)