Fix potential NPE in saving a property that didn't define a type.

This commit is contained in:
LexManos 2012-11-27 02:14:20 -08:00
parent 81b5db6f37
commit 50426ea0fe

View file

@ -150,8 +150,8 @@ public class ConfigCategory implements Map<String, Property>
if (prop.isList())
{
out.write(String.format(pad + "%s:%s <" + NEW_LINE, prop.getType().getID(), propName));
pad = getIndent(indent + 2)
;
pad = getIndent(indent + 2);
for (String line : prop.valueList)
{
out.write(pad + line + NEW_LINE);
@ -159,6 +159,10 @@ public class ConfigCategory implements Map<String, Property>
out.write(getIndent(indent + 1) + " >" + NEW_LINE);
}
else if (prop.getType() == null)
{
out.write(String.format(pad + "%s=%s" + NEW_LINE, propName, prop.value));
}
else
{
out.write(String.format(pad + "%s:%s=%s" + NEW_LINE, prop.getType().getID(), propName, prop.value));