Contact nil checking
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
Sarah Jamie Lewis 2021-09-30 10:18:50 -07:00
parent 2145d38d15
commit 3aac1dd47a
1 changed files with 1 additions and 1 deletions

View File

@ -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)
}
}