From 4d93e94dbd74b0d59559079d94f0f23fc0eb0844 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 21 Feb 2019 03:06:11 +0100 Subject: [PATCH] Fix CraftInventoryMerchant#getSelectedRecipe if there is no active merchant recipe. By: blablubbabc --- .../bukkit/craftbukkit/inventory/CraftInventoryMerchant.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryMerchant.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryMerchant.java index 4a0b5f844f..10b125300c 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryMerchant.java +++ b/paper-server/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