From 14cd1688dafaaf6201b6b1a76fe2805681343f98 Mon Sep 17 00:00:00 2001 From: blablubbabc Date: Thu, 21 Feb 2019 03:06:11 +0100 Subject: [PATCH] Fix CraftInventoryMerchant#getSelectedRecipe if there is no active merchant recipe. --- .../bukkit/craftbukkit/inventory/CraftInventoryMerchant.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryMerchant.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryMerchant.java index 4a0b5f844f..10b125300c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryMerchant.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryMerchant.java @@ -17,7 +17,8 @@ public class CraftInventoryMerchant extends CraftInventory implements MerchantIn @Override public MerchantRecipe getSelectedRecipe() { - return getInventory().getRecipe().asBukkit(); + net.minecraft.server.MerchantRecipe nmsRecipe = getInventory().getRecipe(); + return (nmsRecipe == null) ? null : nmsRecipe.asBukkit(); } @Override