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 authored and muayyad-alsadi committed Apr 21, 2019
1 parent dbdf7a8 commit 3ab9758
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/podman/pod_inspect.go
Expand Up @@ -44,6 +44,11 @@ func podInspectCmd(c *cliconfig.PodInspectValues) error {
pod *adapter.Pod
)
args := c.InputArgs

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

runtime, err := adapter.GetRuntime(&c.PodmanCommand)
if err != nil {
return errors.Wrapf(err, "could not get runtime")
Expand Down

0 comments on commit 3ab9758

Please sign in to comment.