mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-27 11:37:38 +01:00
Catch NumberFormatException
This commit is contained in:
parent
e0597f2df1
commit
dea44d7cbc
@ -136,6 +136,8 @@ public class EssentialsSign
|
||||
{
|
||||
throw new SignException(Util.i18n("invalidCharge"));
|
||||
}
|
||||
try
|
||||
{
|
||||
final int quantity = Integer.parseInt(split[0]);
|
||||
if (quantity <= 1)
|
||||
{
|
||||
@ -148,6 +150,11 @@ public class EssentialsSign
|
||||
}
|
||||
sign.setLine(index, quantity + " " + item);
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
throw new SignException(Util.i18n("invalidCharge"), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected final ItemStack getItemStack(final String itemName) throws SignException
|
||||
@ -187,6 +194,8 @@ public class EssentialsSign
|
||||
{
|
||||
throw new SignException(Util.i18n("invalidCharge"));
|
||||
}
|
||||
try
|
||||
{
|
||||
final int quantity = Integer.parseInt(split[0]);
|
||||
if (quantity <= 1)
|
||||
{
|
||||
@ -205,6 +214,11 @@ public class EssentialsSign
|
||||
return new Charge(quantity, ess);
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
throw new SignException(Util.i18n("invalidCharge"), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user