Changeset 13175


Ignore:
Timestamp:
2006-10-27T15:02:29+13:00 (17 years ago)
Author:
mdewsnip
Message:

Added a check to prevent a NPE and display an error message when plugin/classifier options XML couldn't be parsed.

Location:
trunk/gli/src/org/greenstone/gatherer/greenstone
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/greenstone/Classifiers.java

    r12702 r13175  
    239239    {
    240240    Document document = XMLTools.parseXML(new StringReader(xml));
     241    if (document == null) {
     242        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.ClassifierManager.Classifier_XML_Parse_Failed", classifier.getName()), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
     243        return;
     244    }
     245
    241246    parseClassifierInfoXMLNode(classifier, document.getDocumentElement());
    242247    }
  • trunk/gli/src/org/greenstone/gatherer/greenstone/Plugins.java

    r12702 r13175  
    240240    {
    241241    Document document = XMLTools.parseXML(new StringReader(xml));
     242    if (document == null) {
     243        JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("CDM.PlugInManager.PlugIn_XML_Parse_Failed", plugin.getName()), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);
     244        return;
     245    }
     246
    242247    parsePluginInfoXMLNode(plugin, document.getDocumentElement());
    243248    }
Note: See TracChangeset for help on using the changeset viewer.