Contact nil checking

pull/28/head
Sarah Jamie Lewis 1 year ago
parent 2145d38d15
commit 3aac1dd47a
  1. 2
      utils/manager.go

@ -113,7 +113,7 @@ func (p *PeerHelper) GetNick(id string) string {
// we do not have a canonical nick for this contact.
// re-request if authenticated
// TODO: This check probably doesn't belong here...
if p.peer.GetContact(id).State == connections.ConnectionStateName[connections.AUTHENTICATED] {
if contact := p.peer.GetContact(id); contact != nil && contact.State == connections.ConnectionStateName[connections.AUTHENTICATED] {
p.peer.SendGetValToPeer(id, attr.PublicScope, constants.Name)
}
}

Loading…
Cancel
Save