From f982e55c4ffdaae77fd0ffa11d8f089cb0915c20 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 16 May 2023 15:45:56 -0700 Subject: [PATCH] Safety check on unreachable case --- protocol/connections/engine.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/protocol/connections/engine.go b/protocol/connections/engine.go index 7db469e..34ec0f8 100644 --- a/protocol/connections/engine.go +++ b/protocol/connections/engine.go @@ -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)