You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ke...@apache.org on 2001/08/15 12:46:59 UTC

cvs commit: xml-fop/src/org/apache/fop/fo FOTreeBuilder.java

keiron      01/08/15 03:46:59

  Modified:    src/org/apache/fop/fo FOTreeBuilder.java
  Log:
  fixes some npe's if characters outsite root
  and if namespace not specified/correct
  
  Revision  Changes    Path
  1.24      +7 -2      xml-fop/src/org/apache/fop/fo/FOTreeBuilder.java
  
  Index: FOTreeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FOTreeBuilder.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- FOTreeBuilder.java	2001/08/06 09:12:58	1.23
  +++ FOTreeBuilder.java	2001/08/15 10:46:59	1.24
  @@ -1,5 +1,5 @@
   /*
  - * $Id: FOTreeBuilder.java,v 1.23 2001/08/06 09:12:58 keiron Exp $
  + * $Id: FOTreeBuilder.java,v 1.24 2001/08/15 10:46:59 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -137,7 +137,9 @@
        * 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 @@
                                                   (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);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org