From fd40575cb4283b97051920707b3f44641fccae1a Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Thu, 1 Jun 2023 14:18:34 -0400 Subject: [PATCH] Fix issue with time when a player reconnects without a world --- src/main/java/emu/grasscutter/game/player/Player.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/player/Player.java b/src/main/java/emu/grasscutter/game/player/Player.java index c2ffa060a..246c8a370 100644 --- a/src/main/java/emu/grasscutter/game/player/Player.java +++ b/src/main/java/emu/grasscutter/game/player/Player.java @@ -345,8 +345,9 @@ public class Player implements PlayerHook, FieldFetch { this.playerGameTime = gameTime; // If the player is the host of the world, update the game time as well. - if (this.getWorld().getHost() == this) { - this.getWorld().changeTime(gameTime); + var world = this.getWorld(); + if (world != null && world.getHost() == this) { + world.changeTime(gameTime); } // Trigger the script event for game time update.