Commit acba80d5 authored by Kevin Seidel's avatar Kevin Seidel
Browse files

Avoid deref cln if nil

parent 8c581d45
......@@ -254,13 +254,13 @@ func cmdConnect(c *cli.Context) error {
if err == nil {
curr.client = cln
curr.clients[cln.Addr().String()] = cln
go func() {
<-cln.Disconnected()
delete(curr.clients, cln.Addr().String())
curr.client = nil
fmt.Printf("\n%s disconnected\n", cln.Addr().String())
}()
}
go func() {
<-cln.Disconnected()
delete(curr.clients, cln.Addr().String())
curr.client = nil
fmt.Printf("\n%s disconnected\n", cln.Addr().String())
}()
return err
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment