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