From 3ba9b263103d2cd5218246b05d19b6485347ae28 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sun, 18 Nov 2012 18:18:45 -0500 Subject: [PATCH] Fix server crash on /clearpassword According to #253, using `/clearpassword` without an argument causes the server to crash from an assertion failure. I've resubmitted matttpt's patch as a pull request to aid in merging. --- builtin/chatcommands.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/chatcommands.lua b/builtin/chatcommands.lua index 9f55f1af..f25a276e 100644 --- a/builtin/chatcommands.lua +++ b/builtin/chatcommands.lua @@ -215,8 +215,8 @@ minetest.register_chatcommand("clearpassword", { privs = {password=true}, func = function(name, param) toname = param - if not toname then - minetest.chat_send_player(toname, "Name field required") + if toname == "" then + minetest.chat_send_player(name, "Name field required") return end minetest.set_player_password(toname, '') -- 2.30.2