mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-22 20:09:41 +01:00
avoid nil reference in who reply
This commit is contained in:
parent
a34443f155
commit
0e07b29010
@ -228,8 +228,12 @@ func RplChannelModeIs(channel *Channel) Reply {
|
||||
// <channel> <user> <host> <server> <nick> ( "H" / "G" ) ["*"] [ ( "@" / "+" ) ]
|
||||
// :<hopcount> <real name>
|
||||
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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user