Skip to content

Commit c15f44e

Browse files
authored
Merge pull request #3566 from char8/char8/fix-podman-inspect-crash
address another nil ptr check in podmanFactory.CanHandleAndAccept()
2 parents 256737f + bc7a83a commit c15f44e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

container/podman/factory.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func (f *podmanFactory) CanHandleAndAccept(name string) (handle bool, accept boo
9494
if err != nil {
9595
return false, true, fmt.Errorf("error inspecting container: %v", err)
9696
}
97-
if ctnr.State == nil || !ctnr.State.Running {
97+
if ctnr.ContainerJSONBase == nil || ctnr.State == nil || !ctnr.State.Running {
9898
return false, true, fmt.Errorf("container not running")
9999
}
100100
return true, true, nil

0 commit comments

Comments
 (0)