From 0ca78b086a33642c8f115f515f10757e12f4abae Mon Sep 17 00:00:00 2001 From: Bartosz Oleaczek Date: Fri, 20 Dec 2024 17:02:23 +0100 Subject: [PATCH] fix crash on nordvpn connect --- daemon/vpn/quench/libquench.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/daemon/vpn/quench/libquench.go b/daemon/vpn/quench/libquench.go index d4dab64f..a2168ef8 100644 --- a/daemon/vpn/quench/libquench.go +++ b/daemon/vpn/quench/libquench.go @@ -58,7 +58,9 @@ func (o *Observer) SubscribeToEvents(ctx context.Context) <-chan vpn.State { o.mu.Lock() defer o.mu.Unlock() - close(o.eventsChan) + if o.eventsChan != nil { + close(o.eventsChan) + } eventsChan := make(chan vpn.State) o.eventsChan = eventsChan