mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 10:10:08 -08:00
avoid nil reference in who reply
This commit is contained in:
parent
a34443f155
commit
0e07b29010
1 changed files with 5 additions and 1 deletions
|
|
@ -228,8 +228,12 @@ func RplChannelModeIs(channel *Channel) Reply {
|
||||||
// <channel> <user> <host> <server> <nick> ( "H" / "G" ) ["*"] [ ( "@" / "+" ) ]
|
// <channel> <user> <host> <server> <nick> ( "H" / "G" ) ["*"] [ ( "@" / "+" ) ]
|
||||||
// :<hopcount> <real name>
|
// :<hopcount> <real name>
|
||||||
func RplWhoReply(server *Server, channel *Channel, client *Client) Reply {
|
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",
|
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)
|
client.realname)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue