]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fixed potential NPE.
authorJeremias Maerki <jeremias@apache.org>
Tue, 17 Jun 2008 12:59:25 +0000 (12:59 +0000)
committerJeremias Maerki <jeremias@apache.org>
Tue, 17 Jun 2008 12:59:25 +0000 (12:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_95@668641 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/FObj.java

index b2587df2dc47b1143f7e24b858f4de3e4ef25c45..b9963f20e64834dfe6546766b2c38c1972ba51fc 100644 (file)
@@ -27,13 +27,14 @@ import java.util.Map;
 import java.util.NoSuchElementException;
 import java.util.Set;
 
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.extensions.ExtensionAttachment;
 import org.apache.fop.fo.flow.Marker;
 import org.apache.fop.fo.properties.PropertyMaker;
 import org.apache.fop.util.QName;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
 
 /**
  * Base class for representation of formatting objects and their processing.
@@ -179,7 +180,7 @@ public abstract class FObj extends FONode implements Constants {
                     if (log.isWarnEnabled()) {
                         StringBuffer msg = new StringBuffer();
                         msg.append("Found non-unique id on ").append(getName());
-                        if (locator.getLineNumber() != -1) {
+                        if (locator != null && locator.getLineNumber() != -1) {
                             msg.append(" (at ").append(locator.getLineNumber())
                                 .append("/").append(locator.getColumnNumber())
                                 .append(")");