From e9b7eee57bb8735bde6d0f1bc0c62c65eeb76889 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Wed, 26 Oct 2022 22:06:11 +0200 Subject: [PATCH] Fix NullPointerException in StackingTask Kinda related to c6320cb141043c2179574157272568365e7d4b07 --- .../java/com/songoda/ultimatestacker/tasks/StackingTask.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/songoda/ultimatestacker/tasks/StackingTask.java b/src/main/java/com/songoda/ultimatestacker/tasks/StackingTask.java index f760f48..a0950a1 100644 --- a/src/main/java/com/songoda/ultimatestacker/tasks/StackingTask.java +++ b/src/main/java/com/songoda/ultimatestacker/tasks/StackingTask.java @@ -284,6 +284,10 @@ public class StackingTask extends BukkitRunnable { // Make the friend the new stack host. EntityStack newStack = stackManager.updateStack(livingEntity, entity); + if (newStack == null) { + continue; + } + // Add our entity to that stack plugin.getDataManager().createStackedEntity(newStack, newStack.addEntityToStack(livingEntity));