Skip to content

Commit

Permalink
chore: null check
Browse files Browse the repository at this point in the history
  • Loading branch information
ybw0014 committed Sep 17, 2024
1 parent 657d353 commit 212726b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private double getChance(@Nonnull EntityType type, @Nullable Player killer) {

ItemStack item = killer.getInventory().getItemInMainHand();
SwordOfBeheading sword = (SwordOfBeheading) SlimefunItems.SWORD_OF_BEHEADING.getItem();
if (item.isEmpty() || !sword.isItem(item) || sword.isDisabledIn(killer.getWorld())) {
if (item.isEmpty() || sword == null || !sword.isItem(item) || sword.isDisabledIn(killer.getWorld())) {
return chance;
}

Expand Down

0 comments on commit 212726b

Please # to comment.