configpanel: Catch NumberFormatException

This commit is contained in:
Owain van Brakel
2020-04-19 18:33:50 +02:00
parent 83f0ac6eb6
commit aa38ebd988

View File

@@ -589,7 +589,15 @@ class ConfigPanel extends PluginPanel
if (cid.getType() == int.class) if (cid.getType() == int.class)
{ {
int value = Integer.parseInt(configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName())); int value;
try
{
value = Integer.parseInt(configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName()));
}
catch (NumberFormatException ex)
{
return;
}
Units units = cid.getUnits(); Units units = cid.getUnits();
Range range = cid.getRange(); Range range = cid.getRange();