From: Keiron Liddle Date: Fri, 11 Aug 2000 00:46:51 +0000 (+0000) Subject: fixes an npe if we get an unknown namespace X-Git-Tag: pre-columns~251 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b566ceb38362f2103e311bae6f6e53d417cf2456;p=xmlgraphics-fop.git fixes an npe if we get an unknown namespace git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193628 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/org/apache/fop/fo/FOTreeBuilder.java b/src/org/apache/fop/fo/FOTreeBuilder.java index 564db13cd..51c2941e9 100644 --- a/src/org/apache/fop/fo/FOTreeBuilder.java +++ b/src/org/apache/fop/fo/FOTreeBuilder.java @@ -82,8 +82,6 @@ public class FOTreeBuilder extends DefaultHandler { * class that builds a property list for each formatting object */ protected Hashtable propertylistTable = new Hashtable(); -// protected PropertyListBuilder propertyListBuilder = new -// PropertyListBuilder(); /** * current formatting object being handled @@ -226,7 +224,6 @@ public class FOTreeBuilder extends DefaultHandler { public void startElement(String uri, String localName, String rawName, Attributes attlist) throws SAXException { - /* the formatting object started */ FObj fobj; @@ -251,7 +248,7 @@ public class FOTreeBuilder extends DefaultHandler { String fullName = mapName(rawName); fobjMaker = (FObj.Maker) fobjTable.get(fullName); - PropertyListBuilder plBuilder = (PropertyListBuilder)this.propertylistTable.get(uri); + PropertyListBuilder currentListBuilder = (PropertyListBuilder)this.propertylistTable.get(uri); if (fobjMaker == null) { if (!this.unknownFOs.containsKey(fullName)) { @@ -263,8 +260,11 @@ public class FOTreeBuilder extends DefaultHandler { } try { - PropertyList list = plBuilder.makeList(fullName, attlist, - (currentFObj == null) ? null : currentFObj.properties); + PropertyList list = null; + if(currentListBuilder != null) { + list = currentListBuilder.makeList(fullName, attlist, + (currentFObj == null) ? null : currentFObj.properties); + } fobj = fobjMaker.make(currentFObj, list); } catch (FOPException e) { throw new SAXException(e);