From 0f8c0f97d94ca311314c3c09437c2f2152ce9eb5 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sun, 14 Apr 2019 05:27:31 -0700 Subject: [PATCH] Fixing another NPE for brewing --- .../com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java b/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java index 86517a2db..f6b42c285 100644 --- a/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java +++ b/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java @@ -93,12 +93,12 @@ public final class AlchemyPotionBrewer { } private static List getValidIngredients(Player player) { - if(UserManager.getPlayer(player) == null) + if(player == null || UserManager.getPlayer(player) == null) { return PotionConfig.getInstance().getIngredients(1); } - return PotionConfig.getInstance().getIngredients((player == null || !Permissions.isSubSkillEnabled(player, SubSkillType.ALCHEMY_CONCOCTIONS)) ? 1 : UserManager.getPlayer(player).getAlchemyManager().getTier()); + return PotionConfig.getInstance().getIngredients(!Permissions.isSubSkillEnabled(player, SubSkillType.ALCHEMY_CONCOCTIONS) ? 1 : UserManager.getPlayer(player).getAlchemyManager().getTier()); } public static void finishBrewing(BlockState brewingStand, Player player, boolean forced) {