Commit 4d3d451a authored by Andrey Filippov's avatar Andrey Filippov

Made it tolerate emty TSL files (created by accidental launch of xml file in the editor)

parent 056edc94
...@@ -471,8 +471,14 @@ public class XMLConfig extends Config { ...@@ -471,8 +471,14 @@ public class XMLConfig extends Config {
System.out.println("Reading file '" + configFile + "'"); System.out.println("Reading file '" + configFile + "'");
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder(); DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(configFile); Document document;
try {
document = builder.parse(configFile);
} catch(SAXException e){
System.out.println("\n====== Problem parsing '" + configFile + "' - is it empty? =====\n");
return;
}
currentConfigFileName = configFile.getAbsolutePath(); currentConfigFileName = configFile.getAbsolutePath();
findRootNode(document); findRootNode(document);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment