Changeset 26848

Show
Ignore:
Timestamp:
04.02.2013 23:29:15 (7 years ago)
Author:
davidb
Message:

Extra check added to avoid a null-pointer exception (situation came to light when emacs has stored an auto-save file in the XSL area that was not well formed XML). Change is to skip any file that returns NULL when asked for its XML form

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java

    r26555 r26848  
    199199        { 
    200200            Document currentDoc = this.converter.getDOM(currentFile); 
     201            if (currentDoc == null) { 
     202                // Can happen if an editor creates an auto-save temporary file  
     203                // (such as #header.xsl#) that is not well formed XML 
     204                continue; 
     205            } 
     206 
    201207            NodeList metadataElems = currentDoc.getElementsByTagNameNS(GSXML.GSF_NAMESPACE, "metadata"); //gsf:metadata 
    202208            NodeList foreachMetadataElems = currentDoc.getElementsByTagNameNS(GSXML.GSF_NAMESPACE, "foreach-metadata"); //gsf:foreach-metadata