From 0e07b29010a7171f0dcc9d8c376adc24f59f71db Mon Sep 17 00:00:00 2001 From: Jeremy Latt Date: Tue, 11 Feb 2014 09:09:16 -0800 Subject: [PATCH] avoid nil reference in who reply --- irc/reply.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/irc/reply.go b/irc/reply.go index 2a369d76..51f1008e 100644 --- a/irc/reply.go +++ b/irc/reply.go @@ -228,8 +228,12 @@ func RplChannelModeIs(channel *Channel) Reply { // ( "H" / "G" ) ["*"] [ ( "@" / "+" ) ] // : func RplWhoReply(server *Server, channel *Channel, client *Client) Reply { + channelName := "*" + if channel != nil { + channelName = channel.name + } return NewNumericReply(server, RPL_WHOREPLY, "%s %s %s %s %s H :0 %s", - channel.name, client.username, client.hostname, server.name, client.nick, + channelName, client.username, client.hostname, server.name, client.nick, client.realname) }