From 814ae4d9d5540fc352a974dbea516c252c0eae6f Mon Sep 17 00:00:00 2001 From: ByteExceptionM Date: Wed, 14 Jun 2023 01:14:09 +0200 Subject: [PATCH] Fixed NullPointerException when breaking/placing a spawner (#380) * fix: Make Util#getEntityId parameter nullable * Removed JetBrains Nullable * Updated to follow contribution guidelines --------- Co-authored-by: Intelli <6790859+Intelli@users.noreply.github.com> --- src/main/java/net/coreprotect/utility/Util.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/net/coreprotect/utility/Util.java b/src/main/java/net/coreprotect/utility/Util.java index cd1d2b5..1bfdfee 100755 --- a/src/main/java/net/coreprotect/utility/Util.java +++ b/src/main/java/net/coreprotect/utility/Util.java @@ -859,6 +859,10 @@ public class Util extends Queue { } public static int getEntityId(EntityType type) { + if (type == null) { + return -1; + } + return getEntityId(type.name(), true); }