Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] A null pointer error was encountered while trying to shut down the DISPATCH_ONLY server #2532

Open
Jimmy32767255 opened this issue Oct 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Jimmy32767255
Copy link

Logs:

2024-10-22T16:13:23Z INFO:emu.grasscutter.command.CommandMap Command used by server console: stop
2024-10-22T16:13:23Z INFO:emu.grasscutter.command.CommandHandler 正在关闭服务器...
2024-10-22T16:13:23Z ERROR:emu.grasscutter.Grasscutter 命令发生错误:
java.lang.NullPointerException: Cannot invoke "emu.grasscutter.server.game.GameServer.getPlayers()" because the return value of "emu.grasscutter.Grasscutter.getGameServer()" is null
at emu.grasscutter.command.commands.StopCommand.execute(StopCommand.java:20)
at emu.grasscutter.command.CommandMap.lambda$invoke$0(CommandMap.java:331)
at emu.grasscutter.command.CommandMap.invoke(CommandMap.java:335)
at emu.grasscutter.Grasscutter.startConsole(Grasscutter.java:351)
at emu.grasscutter.Grasscutter.main(Grasscutter.java:187)

Possible cause:

The server needs to kick out all players when it is shut down, so it needs to retrieve a list of players. However, on a server with DISPATCH_ONLY, the game service has never been started, so there is no player list. Therefore, a null pointer error occurs when trying to retrieve it.

Screenshot:

71abe9b0-20bc-4a04-ae11-d5673c7343e7

@Jimmy32767255 Jimmy32767255 added the bug Something isn't working label Oct 22, 2024
@Jimmy32767255 Jimmy32767255 changed the title [Bug] 在试图关闭DISPATCH_ONLY的服务器时遇到空指针错误 [Bug] A null pointer error was encountered while trying to shut down the DISPATCH_ONLY server Oct 22, 2024
@Firefly5201314
Copy link

自己修

@MLChinoo
Copy link
Contributor

MLChinoo commented Oct 23, 2024

大神有能力提issue没能力提pr是吗😋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants