Fix potential NPE in saving a property that didn't define a type.
This commit is contained in:
parent
81b5db6f37
commit
50426ea0fe
1 changed files with 6 additions and 2 deletions
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue