Fix potential NPE for salvage

This commit is contained in:
nossr50 2020-02-19 11:38:48 -08:00
parent 38d64f207d
commit ab6dbe306d
2 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,8 @@ Version 2.1.115
Fixed an issue with arrows causing exceptions with players not yet having data loaded Fixed an issue with arrows causing exceptions with players not yet having data loaded
Spectral arrows are now tracked by mcMMO Spectral arrows are now tracked by mcMMO
Use minimum level of salvageable properly Use minimum level of salvageable properly
Fix axes Critical Strikes default permissions Fix Axes Critical Strikes default permissions ( new fixed permission: mcmmo.ability.axes.criticalstrikes )
Fix potential null pointer exception for salvage
Version 2.1.114 Version 2.1.114
Fix some more locale usages, should aim to further prevent issues with oddball locales Fix some more locale usages, should aim to further prevent issues with oddball locales

View File

@ -66,7 +66,7 @@ public class SalvageManager extends SkillManager {
Salvageable salvageable = mcMMO.getSalvageableManager().getSalvageable(item.getType()); Salvageable salvageable = mcMMO.getSalvageableManager().getSalvageable(item.getType());
if (item.getItemMeta().isUnbreakable()) { if (item.getItemMeta() != null && item.getItemMeta().isUnbreakable()) {
NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Anvil.Unbreakable"); NotificationManager.sendPlayerInformation(player, NotificationType.SUBSKILL_MESSAGE_FAILED, "Anvil.Unbreakable");
return; return;
} }