Browse Source

Fix potential NPE for salvage

nossr50 5 years ago
parent
commit
ab6dbe306d

+ 2 - 1
Changelog.txt

@@ -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

+ 1 - 1
src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java

@@ -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;
         }
         }