Small change to fix loading configs.

This commit is contained in:
LexManos committed 2012-11-27 22:43:23 -08:00
1 parent e5231f306b
commit 096989d4eb
1 file changed
+11 -3
@@ -535,17 +535,25 @@ public class Configuration
name = line.substring(nameStart, nameEnd + 1);
String qualifiedName = ConfigCategory.getQualifiedName(name, currentCat);
currentCat = categories.get(qualifiedName);
if (currentCat == null)
ConfigCategory cat = categories.get(qualifiedName);
if (cat == null)
{
currentCat = new ConfigCategory(name, null);
currentCat = new ConfigCategory(name, currentCat);
categories.put(qualifiedName, currentCat);
}
else
{
currentCat = cat;
}
name = null;
break;
case '}':
if (currentCat == null)
{
throw new RuntimeException(String.format("Config file corrupt, attepted to close to many categories '%s:%d'", fileName, lineNum));
}
currentCat = currentCat.parent;
break;