Skip to content

Commit 4d634ef

Browse files
red-001nerzhul
authored andcommitted
Fix crash that can be caused by the shutdown command. (#5292)
1 parent 2d1fca5 commit 4d634ef

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

builtin/game/chatcommands.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,8 @@ core.register_chatcommand("shutdown", {
842842
core.log("action", name .. " shuts down server")
843843
core.chat_send_all("*** Server shutting down (operator request).")
844844
local reconnect, message = param:match("([^ ]+)(.*)")
845-
core.request_shutdown(message:trim(), minetest.is_yes(reconnect))
845+
message = message or ""
846+
core.request_shutdown(message:trim(), core.is_yes(reconnect))
846847
end,
847848
})
848849

0 commit comments

Comments
 (0)