From 921a8fb9357f174e8d1f97419522085c02dfc983 Mon Sep 17 00:00:00 2001 From: yusing Date: Tue, 28 Oct 2025 23:49:59 +0800 Subject: [PATCH] fix(monitor): handle missing container state in Docker health check --- internal/watcher/health/monitor/docker.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/watcher/health/monitor/docker.go b/internal/watcher/health/monitor/docker.go index 74df91a8..d7414ca7 100644 --- a/internal/watcher/health/monitor/docker.go +++ b/internal/watcher/health/monitor/docker.go @@ -1,6 +1,7 @@ package monitor import ( + "errors" "net/http" "github.com/bytedance/sonic" @@ -70,6 +71,10 @@ func (mon *DockerHealthMonitor) interceptInspectResponse(resp *http.Response) (i if err != nil { return false, err } + + if state.State == nil { + return false, errors.New("container state not found") + } return true, httputils.NewRequestInterceptedError(resp, state) }