From bc7a83a02890096f52b309d6fe81e12928538fa5 Mon Sep 17 00:00:00 2001 From: Charith Amarasinghe Date: Wed, 17 Jul 2024 01:36:43 +0100 Subject: [PATCH] nil check .ContainerJSONBase in the podman inspect response --- container/podman/factory.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container/podman/factory.go b/container/podman/factory.go index a05efcc227..007148676b 100644 --- a/container/podman/factory.go +++ b/container/podman/factory.go @@ -94,7 +94,7 @@ func (f *podmanFactory) CanHandleAndAccept(name string) (handle bool, accept boo if err != nil { return false, true, fmt.Errorf("error inspecting container: %v", err) } - if ctnr.State == nil || !ctnr.State.Running { + if ctnr.ContainerJSONBase == nil || ctnr.State == nil || !ctnr.State.Running { return false, true, fmt.Errorf("container not running") } return true, true, nil