From 35dc924104b7ae0f30de48457e79a351bef3203f Mon Sep 17 00:00:00 2001 From: lars Date: Wed, 15 Oct 2025 21:30:11 +0200 Subject: [PATCH] added null ckeck for boostTask and boostRefillTask --- .../game/stateless/types/turtleGame/gameObjects/Turtle.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/mhsl/minenet/minigames/instance/game/stateless/types/turtleGame/gameObjects/Turtle.java b/src/main/java/eu/mhsl/minenet/minigames/instance/game/stateless/types/turtleGame/gameObjects/Turtle.java index 2f9328b..539ee8d 100644 --- a/src/main/java/eu/mhsl/minenet/minigames/instance/game/stateless/types/turtleGame/gameObjects/Turtle.java +++ b/src/main/java/eu/mhsl/minenet/minigames/instance/game/stateless/types/turtleGame/gameObjects/Turtle.java @@ -46,8 +46,8 @@ public class Turtle extends EntityCreature { this.removePassenger(this.player); this.remove(); this.kill(); - if(this.boostRefillTask.isAlive()) this.boostRefillTask.cancel(); - if(this.boostTask.isAlive()) this.boostTask.cancel(); + if(this.boostRefillTask != null && this.boostRefillTask.isAlive()) this.boostRefillTask.cancel(); + if(this.boostTask != null && this.boostTask.isAlive()) this.boostTask.cancel(); } public void adaptView() { @@ -82,7 +82,7 @@ public class Turtle extends EntityCreature { } public void cancelBoost() { - if(!this.boostTask.isAlive()) return; + if(this.boostTask == null || !this.boostTask.isAlive()) return; this.boostTask.cancel(); this.boostSpeedMultiplier = 1; }