Fix panic when no image is given

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #31
Approved by: mheon
This commit is contained in:
Daniel J Walsh
2017-11-08 08:47:53 -05:00
committed by Atomic Bot
parent 0e2fc603d9
commit 84e3bdceda

View File

@ -242,11 +242,11 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime) (*createConfig, er
var blkioWeight uint16
var uid, gid uint32
image := c.Args()[0]
if len(c.Args()) < 1 {
return nil, errors.Errorf("image name or ID is required")
}
image := c.Args()[0]
if len(c.Args()) > 1 {
command = c.Args()[1:]
}