Safety check on unreachable case
continuous-integration/drone/pr Build is pending Details

This commit is contained in:
Sarah Jamie Lewis 2023-05-16 15:45:56 -07:00
parent bc522b57c1
commit f982e55c4f
1 changed files with 3 additions and 1 deletions

View File

@ -374,7 +374,9 @@ func (e *engine) peerWithOnion(onion string) {
return
}
log.Debugf("PeerWithOnion something went very wrong...%v %v", onion, err)
conn.Close()
if conn != nil {
conn.Close()
}
e.ignoreOnShutdown(e.peerDisconnected)(onion)
} else {
log.Debugf("PeerWithOnion %v %v", onion, err)