Changeset 29439


Ignore:
Timestamp:
11/17/14 13:53:30 (6 years ago)
Author:
kjdon
Message:

fixed up a few null pointer exceptions that showed up with infomine collection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/DocumentAction.java

    r29307 r29439  
    197197            document_type = getDocumentType(basic_doc_list, collection, userContext, page_response);
    198198        }
    199         if (document_type != null)
    200         {
    201             // set the doctype from the cgi arg or from the server as an attribute
    202             the_document.setAttribute(GSXML.DOC_TYPE_ATT, document_type);
    203         }
    204         else
    205         {
    206             logger.error("doctype is null!!!***********");
    207         }
     199        if (document_type == null)
     200        {
     201            logger.error("doctype is null!!!***********");
     202            document_type = GSXML.DOC_TYPE_SIMPLE;
     203        }
     204       
     205        the_document.setAttribute(GSXML.DOC_TYPE_ATT, document_type);
     206       
    208207
    209208        // Create a parameter list to specify the required structure information
     
    772771        String path = GSPath.createPath(links);
    773772        Element info_elem = (Element) GSXML.getNodeByPath(ds_response_message, path);
     773        if (info_elem == null) {
     774            return null;
     775        }
    774776        Element doctype_elem = GSXML.getNamedElement(info_elem, "info", "name", "documentType");
    775777        if (doctype_elem != null)
Note: See TracChangeset for help on using the changeset viewer.