Skip to content

Commit

Permalink
pod: fix segfault when there are no arguments to inspect
Browse files Browse the repository at this point in the history
Closes: containers#2681

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
  • Loading branch information
giuseppe committed Mar 17, 2019
1 parent 8aed32a commit 3f37280
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/podman/pod_inspect.go
Expand Up @@ -50,6 +50,10 @@ func podInspectCmd(c *cliconfig.PodInspectValues) error {
}
defer runtime.Shutdown(false)

if len(args) < 1 && !c.Latest {
return errors.Errorf("you must provide the name or id of a pod")
}

if c.Latest {
pod, err = runtime.GetLatestPod()
if err != nil {
Expand Down

0 comments on commit 3f37280

Please sign in to comment.