diff options
author | Keiron Liddle <keiron@apache.org> | 2001-08-15 10:46:59 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2001-08-15 10:46:59 +0000 |
commit | 6460073f07d51142dfd25e012552d5c9284bf853 (patch) | |
tree | 8868d86359d1cee003931b67265390c1a79c84e6 | |
parent | 0f35bc7169d84932ede357e9f625da8b272132a3 (diff) | |
download | xmlgraphics-fop-6460073f07d51142dfd25e012552d5c9284bf853.tar.gz xmlgraphics-fop-6460073f07d51142dfd25e012552d5c9284bf853.zip |
fixes some npe's if characters outsite root
and if namespace not specified/correct
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194426 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/org/apache/fop/fo/FOTreeBuilder.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/org/apache/fop/fo/FOTreeBuilder.java b/src/org/apache/fop/fo/FOTreeBuilder.java index 94e431f52..0ebaecc01 100644 --- a/src/org/apache/fop/fo/FOTreeBuilder.java +++ b/src/org/apache/fop/fo/FOTreeBuilder.java @@ -137,7 +137,9 @@ public class FOTreeBuilder extends DefaultHandler implements TreeBuilder { * SAX Handler for characters */ public void characters(char data[], int start, int length) { - currentFObj.addCharacters(data, start, start + length); + if(currentFObj != null) { + currentFObj.addCharacters(data, start, start + length); + } } /** @@ -207,6 +209,9 @@ public class FOTreeBuilder extends DefaultHandler implements TreeBuilder { (currentFObj == null) ? null : currentFObj.properties, currentFObj); } else { + if(currentFObj == null) { + throw new FOPException("Invalid XML or missing namespace"); + } list = currentFObj.properties; } fobj = fobjMaker.make(currentFObj, list); |