From 4f644641a67fa5b7542fc0ebf28866d7812ce0a2 Mon Sep 17 00:00:00 2001 From: Brianna Date: Thu, 26 Mar 2020 18:36:53 -0400 Subject: [PATCH] Fix for nullpointerexception. --- .../com/songoda/core/compatibility/CompatibleMaterial.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java b/Core/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java index b8a36a56..83b9a3eb 100644 --- a/Core/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java +++ b/Core/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java @@ -1677,7 +1677,11 @@ public enum CompatibleMaterial { if (entityName.equals("ZOMBIE_PIGMAN")) { return EntityType.PIG_ZOMBIE; } - return EntityType.valueOf(entityName); + try { + return EntityType.valueOf(entityName); + } catch (IllegalArgumentException e) { + return null; + } } /**