]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
gets around a possible npe
authorKeiron Liddle <keiron@apache.org>
Fri, 21 Sep 2001 09:08:38 +0000 (09:08 +0000)
committerKeiron Liddle <keiron@apache.org>
Fri, 21 Sep 2001 09:08:38 +0000 (09:08 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194473 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/fo/FONode.java
src/org/apache/fop/fo/flow/Marker.java

index a620eb23527571695e43b293b5cb45be5c9174b8..af4791a409d5294467d512f971b883908daa4014 100644 (file)
@@ -234,11 +234,14 @@ abstract public class FONode {
 
     public void addMarker(Marker marker) throws FOPException {
         String mcname = marker.getMarkerClassName();
-        if (!markers.containsKey(mcname) && children.isEmpty())
+        if (!markers.containsKey(mcname) && children.isEmpty()) {
             markers.put(mcname, marker);
-        else
+        } else {
+            log.error("fo:marker must be an initial child,"
+                                   + "and 'marker-class-name' must be unique for same parent");
             throw new FOPException("fo:marker must be an initial child,"
                                    + "and 'marker-class-name' must be unique for same parent");
+        }
     }
 
     public boolean hasMarkers() {
index 762ed832733f7a13ed7041578f9ef2cdb47435c1..0eb0baaa58c18dad9605b8a4e040f148962d4843 100644 (file)
@@ -45,8 +45,9 @@ public class Marker extends FObjMixed {
         try {
             parent.addMarker(this);
         } catch (FOPException fopex) {
-            log.error("marker cannot be added to '" + parent
-                                 + "'");
+            // log is null in constructor
+            //log.error("marker cannot be added to '" + parent
+            //                     + "'");
         }
     }