Changeset 29164 for main/trunk


Ignore:
Timestamp:
2014-07-28T12:58:55+12:00 (10 years ago)
Author:
kjdon
Message:

check for null coll_config_xml before trying to modify it for debug, otherwise get null pointer exception. this will happen if you have a folder in collect which is not actually a collection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/Collection.java

    r29049 r29164  
    117117
    118118        Element coll_config_xml = loadCollConfigFile();
     119        if (coll_config_xml == null) {
     120          logger.error("Collection: couldn't configure collection: " + this.cluster_name + ", " + "Couldn't load collection config file");
     121
     122          return false;
     123        }
     124        Element build_config_xml = loadBuildConfigFile();
     125
     126        if (build_config_xml == null)
     127        {
     128          logger.error("Collection: couldn't configure collection: " + this.cluster_name + ", " + "Couldn't load build config file");
     129
     130          return false;
     131        }
     132
    119133        GSXSLT.modifyCollectionConfigForDebug(coll_config_xml);
    120         Element build_config_xml = loadBuildConfigFile();
    121 
    122         if (coll_config_xml == null || build_config_xml == null)
    123         {
    124             return false;
    125         }
    126 
    127134        // get the collection type attribute
    128135        Element search = (Element) GSXML.getChildByTagName(coll_config_xml, GSXML.SEARCH_ELEM);
     
    193200        if (!coll_config_file.exists())
    194201        {
    195             logger.error("Collection: couldn't configure collection: " + this.cluster_name + ", " + coll_config_file + " does not exist");
    196202            return null;
    197203        }
Note: See TracChangeset for help on using the changeset viewer.