From c81830efecaee6baee25148669be28c47602943b Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Mon, 13 Apr 2020 19:04:01 +0100 Subject: [PATCH] Neither of these should be null. I should not have to check they aren't null. But apparently they can be. So I do. Fixes #402. --- src/main/java/electroblob/wizardry/util/WizardryUtilities.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/electroblob/wizardry/util/WizardryUtilities.java b/src/main/java/electroblob/wizardry/util/WizardryUtilities.java index 6e019a5e..93727027 100644 --- a/src/main/java/electroblob/wizardry/util/WizardryUtilities.java +++ b/src/main/java/electroblob/wizardry/util/WizardryUtilities.java @@ -635,7 +635,7 @@ public final class WizardryUtilities { // This is a perfect example of where you need to use .equals() and not ==. For most applications, // this was unnoticeable until world reload because the UUID instance or entity instance is stored. // Fixed now though. - if(entity.getUniqueID().equals(id)){ + if(entity != null && entity.getUniqueID() != null && entity.getUniqueID().equals(id)){ return entity; } }