summaryrefslogtreecommitdiff
path: root/builtin/chatcommands.lua
diff options
context:
space:
mode:
authorAnthony <azhang9@gmail.com>2012-11-18 18:18:45 -0500
committerPilzAdam <adam-k@outlook.com>2012-11-20 16:45:30 +0100
commit3ba9b263103d2cd5218246b05d19b6485347ae28 (patch)
tree79fc64e2427febf0bcf5337f3f58ed67f61dd4b1 /builtin/chatcommands.lua
parent5292476841430c55d889b1707cf890638a3dd2a2 (diff)
downloadminetest-3ba9b263103d2cd5218246b05d19b6485347ae28.tar.gz
minetest-3ba9b263103d2cd5218246b05d19b6485347ae28.tar.bz2
minetest-3ba9b263103d2cd5218246b05d19b6485347ae28.zip
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.
Diffstat (limited to 'builtin/chatcommands.lua')
-rw-r--r--builtin/chatcommands.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/chatcommands.lua b/builtin/chatcommands.lua
index 9f55f1afc..f25a276ea 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, '')