From 88e44c9e1d2a6afaa8f633df431e9ddb307e99b9 Mon Sep 17 00:00:00 2001 From: tastybento Date: Fri, 9 Jul 2021 16:19:32 -0700 Subject: [PATCH] Assert if worlds are null. They should never be. --- src/main/java/world/bentobox/acidisland/world/AcidTask.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/world/bentobox/acidisland/world/AcidTask.java b/src/main/java/world/bentobox/acidisland/world/AcidTask.java index 8a62bf9..64e017b 100644 --- a/src/main/java/world/bentobox/acidisland/world/AcidTask.java +++ b/src/main/java/world/bentobox/acidisland/world/AcidTask.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.WeakHashMap; import java.util.concurrent.ConcurrentHashMap; @@ -103,10 +104,10 @@ public class AcidTask { List entityStream = new ArrayList<>(addon.getOverWorld().getEntities()); // Nether and end if (addon.getSettings().isNetherGenerate() && addon.getSettings().isNetherIslands()) { - entityStream.addAll(addon.getNetherWorld().getEntities()); + entityStream.addAll(Objects.requireNonNull(addon.getNetherWorld()).getEntities()); } if (addon.getSettings().isEndGenerate() && addon.getSettings().isEndIslands()) { - entityStream.addAll(addon.getEndWorld().getEntities()); + entityStream.addAll(Objects.requireNonNull(addon.getEndWorld()).getEntities()); } return entityStream; }