]> git.lizzy.rs Git - minetest.git/commitdiff
Fix server crash on /clearpassword
authorAnthony <azhang9@gmail.com>
Sun, 18 Nov 2012 23:18:45 +0000 (18:18 -0500)
committerPilzAdam <adam-k@outlook.com>
Tue, 20 Nov 2012 15:45:30 +0000 (16:45 +0100)
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

index 9f55f1afcbddd9441098fadadf7445ed4d577f6d..f25a276ea6eac05860c5e8d75514b14918f20907 100644 (file)
@@ -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, '')