From 54660e629a286981ee9c987c6652b88e4a1b1497 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 3 Nov 2023 23:41:09 +0000 Subject: [PATCH] Don't panic when connect returns `nil` (fixes #1086) It isn't clear to me why this would happen but let's guard the condition anyway. --- src/core/link.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/link.go b/src/core/link.go index 0b2efc57..e42f127f 100644 --- a/src/core/link.go +++ b/src/core/link.go @@ -273,7 +273,7 @@ func (l *links) add(u *url.URL, sintf string, linkType linkType) error { } conn, err := l.connect(state.ctx, u, info, options) - if err != nil { + if err != nil || conn == nil { if linkType == linkTypePersistent { // If the link is a persistent configured peering, // store information about the connection error so