From 32294995befaed330338e2bb42a6a7ddf6172513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez?= Date: Sat, 17 Jan 2015 22:41:24 -0300 Subject: [PATCH] Fix `/irc_names` crashing if not connected. --- chatcmds.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chatcmds.lua b/chatcmds.lua index 03599e9..b8ac466 100644 --- a/chatcmds.lua +++ b/chatcmds.lua @@ -45,6 +45,10 @@ minetest.register_chatcommand("irc_names", { params = "", description = "List the users in IRC.", func = function(name, params) + if not irc.connected then + minetest.chat_send_player(name, "Not connected to IRC. Use /irc_connect to connect.") + return + end local users = { } for k, v in pairs(irc.conn.channels[irc.config.channel].users) do table.insert(users, k)