From 23ffb78ab34a987fce43372a66d2efa73a25df68 Mon Sep 17 00:00:00 2001 From: mezz Date: Sun, 7 Dec 2014 16:23:03 -0800 Subject: [PATCH] Improve null safety of memorized recipe isValid check --- src/main/java/forestry/factory/recipes/RecipeMemory.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/forestry/factory/recipes/RecipeMemory.java b/src/main/java/forestry/factory/recipes/RecipeMemory.java index 1afccfd46..02524f5e3 100644 --- a/src/main/java/forestry/factory/recipes/RecipeMemory.java +++ b/src/main/java/forestry/factory/recipes/RecipeMemory.java @@ -130,7 +130,12 @@ public class RecipeMemory implements INBTTagable { public final int capacity = 9; private static boolean isValid(World world, Recipe recipe) { - Item item = recipe.getRecipeOutput(world).getItem(); + if (recipe == null) + return false; + ItemStack recipeOutput = recipe.getRecipeOutput(world); + if (recipeOutput == null) + return false; + Item item = recipeOutput.getItem(); return item != null && !memoryBlacklist.contains(item.getClass()); }