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; }