From: red-001 Date: Sat, 25 Feb 2017 08:28:25 +0000 (+0000) Subject: Fix crash that can be caused by the shutdown command. (#5292) X-Git-Tag: 0.4.16~423 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4d634ef675020964413020f6215529670af0091a;p=oweals%2Fminetest.git Fix crash that can be caused by the shutdown command. (#5292) --- diff --git a/builtin/game/chatcommands.lua b/builtin/game/chatcommands.lua index 54cd6c325..5d5955972 100644 --- a/builtin/game/chatcommands.lua +++ b/builtin/game/chatcommands.lua @@ -842,7 +842,8 @@ core.register_chatcommand("shutdown", { core.log("action", name .. " shuts down server") core.chat_send_all("*** Server shutting down (operator request).") local reconnect, message = param:match("([^ ]+)(.*)") - core.request_shutdown(message:trim(), minetest.is_yes(reconnect)) + message = message or "" + core.request_shutdown(message:trim(), core.is_yes(reconnect)) end, })