Fix crash when no argument is specified on /watch

This commit is contained in:
kilbith 2016-01-02 17:20:50 +01:00
parent 27e6a379c7
commit 2ce331c866

View File

@ -50,7 +50,7 @@ minetest.register_chatcommand("watch", {
privs = {watch=true},
func = function(name, param)
local watcher = minetest.get_player_by_name(name)
local target = minetest.get_player_by_name(param:match("^([^ ]+)$"))
local target = minetest.get_player_by_name(param)
local privs = minetest.get_player_privs(name)
if target and watcher ~= target then