ConfigManager: Fix NPE when resetting configs with null default

This commit is contained in:
paymon123
2020-10-08 14:34:14 -07:00
committed by Tomas Slusny
parent 8438b42e15
commit 03566d6702
3 changed files with 32 additions and 2 deletions

View File

@@ -659,6 +659,7 @@ public class ConfigManager
return str;
}
@Nullable
static String objectToString(Object object)
{
if (object instanceof Color)
@@ -702,7 +703,7 @@ public class ConfigManager
{
return Long.toString(((Duration) object).toMillis());
}
return object.toString();
return object == null ? null : object.toString();
}
@Subscribe(priority = 100)