From d34075861462f34d3206511b63579978cca0d2c9 Mon Sep 17 00:00:00 2001 From: jie65535 Date: Tue, 19 Nov 2024 12:05:24 +0800 Subject: [PATCH] Fix cannot stop in dispatch-only mode (#2534) --- .../java/emu/grasscutter/command/commands/StopCommand.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/emu/grasscutter/command/commands/StopCommand.java b/src/main/java/emu/grasscutter/command/commands/StopCommand.java index a5f9584bb..47f31b6af 100644 --- a/src/main/java/emu/grasscutter/command/commands/StopCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/StopCommand.java @@ -17,8 +17,10 @@ public final class StopCommand implements CommandHandler { @Override public void execute(Player sender, Player targetPlayer, List args) { CommandHandler.sendMessage(null, translate("commands.stop.success")); - for (Player p : Grasscutter.getGameServer().getPlayers().values()) { - CommandHandler.sendMessage(p, translate(p, "commands.stop.success")); + if (Grasscutter.getGameServer() != null) { + for (Player p : Grasscutter.getGameServer().getPlayers().values()) { + CommandHandler.sendMessage(p, translate(p, "commands.stop.success")); + } } System.exit(1000);