forked from minetest-mods/irc
Fix /irc_names
crashing if not connected.
This commit is contained in:
parent
d0ebde3884
commit
32294995be
@ -45,6 +45,10 @@ minetest.register_chatcommand("irc_names", {
|
|||||||
params = "",
|
params = "",
|
||||||
description = "List the users in IRC.",
|
description = "List the users in IRC.",
|
||||||
func = function(name, params)
|
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 = { }
|
local users = { }
|
||||||
for k, v in pairs(irc.conn.channels[irc.config.channel].users) do
|
for k, v in pairs(irc.conn.channels[irc.config.channel].users) do
|
||||||
table.insert(users, k)
|
table.insert(users, k)
|
||||||
|
Loading…
Reference in New Issue
Block a user