fixup panic on watch

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2025-01-18 14:24:44 +03:00
parent 05ee6a3536
commit f62cbcd890

View File

@ -291,6 +291,9 @@ func (r *rtr) watchRegister(w register.Watcher) error {
}
break
}
if res == nil {
continue
}
// don't process nil entries
if res.Service == nil {
@ -301,7 +304,7 @@ func (r *rtr) watchRegister(w register.Watcher) error {
}
if r.opts.Logger.V(logger.TraceLevel) {
r.opts.Logger.Trace(r.opts.Context, fmt.Sprintf("Router dealing with next route %s %+v\n", res.Action, res.Service))
r.opts.Logger.Trace(r.opts.Context, fmt.Sprintf("Router dealing with next route %s %+v", res.Action, res.Service))
}
// get the services domain from metadata. Fallback to wildcard.