mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-04 22:41:33 +01:00
Fix NPE in /repair
This commit is contained in:
parent
06900e19f0
commit
313df9988d
@ -30,6 +30,10 @@ public class Commandrepair extends EssentialsCommand
|
||||
if (args[0].equalsIgnoreCase("hand"))
|
||||
{
|
||||
final ItemStack item = user.getItemInHand();
|
||||
if (item == null)
|
||||
{
|
||||
throw new Exception(Util.i18n("repairInvalidType"));
|
||||
}
|
||||
final String itemName = item.getType().toString().toLowerCase();
|
||||
final Trade charge = new Trade("repair-" + itemName.replace('_', '-'), ess);
|
||||
|
||||
@ -84,6 +88,10 @@ public class Commandrepair extends EssentialsCommand
|
||||
{
|
||||
for (ItemStack item : items)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
final String itemName = item.getType().toString().toLowerCase();
|
||||
final Trade charge = new Trade("repair-" + itemName.replace('_', '-'), ess);
|
||||
try
|
||||
|
Loading…
Reference in New Issue
Block a user