Skip to content

Commit

Permalink
clearer inventory script handling error
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Feb 27, 2019
1 parent 2d5a601 commit 5987e11
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,14 @@ public dInventory getInventoryFrom(dPlayer player, dNPC npc) {
}
}
else if (dItem.matches(item)) {
finalItems[itemsAdded] = dItem.valueOf(item, player, npc).getItemStack();
try {
finalItems[itemsAdded] = dItem.valueOf(item, player, npc).getItemStack();
}
catch (Exception ex) {
dB.echoError("Inventory script \"" + getName() + "\" has an invalid slot item: ["
+ item + "]...");
dB.echoError(ex);
}
}
else {
finalItems[itemsAdded] = new ItemStack(Material.AIR);
Expand Down

0 comments on commit 5987e11

Please sign in to comment.