Skip to content

Commit

Permalink
Prevented NullPointerException, should fix #11
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSpring committed Jul 17, 2016
1 parent 2b08d0d commit d339ddd
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dk.mrspring.kitchen.config;

import cpw.mods.fml.common.registry.GameData;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.item.ItemStack;

Expand Down Expand Up @@ -80,7 +81,7 @@ public SandwichableEntry findEntry(String stack)

public SandwichableEntry findEntry(ItemStack stack)
{
if (stack != null)
if (stack != null && GameData.getItemRegistry().getNameForObject(stack.getItem()) != null)
{
GameRegistry.UniqueIdentifier identifier = GameRegistry.findUniqueIdentifierFor(stack.getItem());
if (identifier != null)
Expand Down

0 comments on commit d339ddd

Please sign in to comment.