mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
Fix router panic for nil watcher
This commit is contained in:
parent
4401c12e6c
commit
8ea84ac3eb
@ -530,7 +530,9 @@ func (r *router) Start() error {
|
||||
for {
|
||||
select {
|
||||
case <-r.exit:
|
||||
if w != nil {
|
||||
w.Stop()
|
||||
}
|
||||
return
|
||||
default:
|
||||
if w == nil {
|
||||
@ -547,10 +549,12 @@ func (r *router) Start() error {
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
|
||||
if w != nil {
|
||||
w.Stop()
|
||||
w = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
r.running = true
|
||||
|
Loading…
Reference in New Issue
Block a user