From db9facf9cb034c8be595fb474b1a3437d54a08f5 Mon Sep 17 00:00:00 2001 From: Viktor Liu <17948409+lixmal@users.noreply.github.com> Date: Mon, 2 Jun 2025 12:14:17 +0200 Subject: [PATCH] Check nil on Stop Co-authored-by: hakansa <43675540+hakansa@users.noreply.github.com> --- client/internal/routemanager/client/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/internal/routemanager/client/client.go b/client/internal/routemanager/client/client.go index c9f0c68d3..579525ea8 100644 --- a/client/internal/routemanager/client/client.go +++ b/client/internal/routemanager/client/client.go @@ -489,6 +489,9 @@ func (w *Watcher) Stop() { w.cancel() + if w.currentChosen == nil { + return + } if err := w.removeAllowedIPs(w.currentChosen, reasonShutdown); err != nil { log.Errorf("Failed to remove routes for [%v]: %v", w.handler, err) }