aboutsummaryrefslogtreecommitdiffstats
path: root/src/org
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2001-02-23 03:47:08 +0000
committerKeiron Liddle <keiron@apache.org>2001-02-23 03:47:08 +0000
commit0d26b9e73912dc202b4bbaeba502064a288715ee (patch)
tree3177e4b1cd704c49ea4dc68683e98e689db71781 /src/org
parent17e0b67569e274eb4e5138325d26fdb5fe625055 (diff)
downloadxmlgraphics-fop-0d26b9e73912dc202b4bbaeba502064a288715ee.tar.gz
xmlgraphics-fop-0d26b9e73912dc202b4bbaeba502064a288715ee.zip
makes checks to prevent exceptions
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194084 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org')
-rw-r--r--src/org/apache/fop/dom/svg/SVGDocumentImpl.java4
-rw-r--r--src/org/apache/fop/fo/FObj.java2
2 files changed, 5 insertions, 1 deletions
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++)