Skip to content

Commit

Permalink
Merge pull request #3566 from char8/char8/fix-podman-inspect-crash
Browse files Browse the repository at this point in the history
address another nil ptr check in podmanFactory.CanHandleAndAccept()
  • Loading branch information
iwankgb authored Aug 7, 2024
2 parents 256737f + bc7a83a commit c15f44e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion container/podman/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c15f44e

Please sign in to comment.