Skip to content

Commit 0b06bbe

Browse files
committed
Fix an edge case where we use the wrong arg in NICK to change the currentnick.
1 parent 2b60822 commit 0b06bbe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ func (c *Client) readLoop() error {
197197
fmt.Printf("!!! Lag: %v\n", delta)
198198
}
199199
} else if e.Command == "NICK" {
200-
if e.Identity.Nick == c.currentNick {
201-
c.currentNick = lastArg
200+
if e.Identity.Nick == c.currentNick && len(e.Args) > 0 {
201+
c.currentNick = e.Args[0]
202202
}
203203
} else if e.Command == "001" {
204204
c.currentNick = e.Args[0]

0 commit comments

Comments
 (0)