mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-18 06:39:54 +00:00
Check nil on Stop
Co-authored-by: hakansa <43675540+hakansa@users.noreply.github.com>
This commit is contained in:
@@ -489,6 +489,9 @@ func (w *Watcher) Stop() {
|
|||||||
|
|
||||||
w.cancel()
|
w.cancel()
|
||||||
|
|
||||||
|
if w.currentChosen == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
if err := w.removeAllowedIPs(w.currentChosen, reasonShutdown); err != nil {
|
if err := w.removeAllowedIPs(w.currentChosen, reasonShutdown); err != nil {
|
||||||
log.Errorf("Failed to remove routes for [%v]: %v", w.handler, err)
|
log.Errorf("Failed to remove routes for [%v]: %v", w.handler, err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user