From 78fbe26a2c1dbc69c7feb03113dd275ea18f35ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez?= Date: Thu, 16 Feb 2017 02:38:44 -0300 Subject: [PATCH] Fix error if `@` with no name is used. --- botcmds.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/botcmds.lua b/botcmds.lua index 4109cf0..e0a0c56 100644 --- a/botcmds.lua +++ b/botcmds.lua @@ -41,7 +41,9 @@ function irc:bot_command(msg, text) text = text:match("^%s*(.*)") if text:sub(1, 1) == "@" then local _, _, player_to, message = text:find("^.([^%s]+)%s(.+)$") - if not minetest.get_player_by_name(player_to) then + if not player_to then + return + elseif not minetest.get_player_by_name(player_to) then irc:reply("User '"..player_to.."' is not in the game.") return elseif not irc.joined_players[player_to] then