aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2017-02-25 08:28:25 +0000
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-02-25 09:28:25 +0100
commit4d634ef675020964413020f6215529670af0091a (patch)
tree6aa9d1eb0ea5aa29eaa837474a4717dccab7b267
parent2d1fca51e975a01f84fa3fd9b266435316fbe548 (diff)
downloadminetest-4d634ef675020964413020f6215529670af0091a.tar.gz
minetest-4d634ef675020964413020f6215529670af0091a.tar.bz2
minetest-4d634ef675020964413020f6215529670af0091a.zip
Fix crash that can be caused by the shutdown command. (#5292)
-rw-r--r--builtin/game/chatcommands.lua3
1 files changed, 2 insertions, 1 deletions
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,
})