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.
This commit is contained in:
Neil Alexander 2023-11-03 23:41:09 +00:00
parent 93a5adfd18
commit 54660e629a
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

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