Fix crash that can be caused by the shutdown command. (#5292)
authorred-001 <red-001@outlook.ie>
Sat, 25 Feb 2017 08:28:25 +0000 (08:28 +0000)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Sat, 25 Feb 2017 08:28:25 +0000 (09:28 +0100)
builtin/game/chatcommands.lua

index 54cd6c3252cd7a8175bd9903182986af60dbedd1..5d59559728c6c672e925c7cf2b0d49b12eb7c99f 100644 (file)
@@ -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,
 })