diff options
-rw-r--r-- | cmd/podman/run.go | 3 | ||||
-rw-r--r-- | libpod/image/image.go | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/cmd/podman/run.go b/cmd/podman/run.go index 523b973fb..21320f57c 100644 --- a/cmd/podman/run.go +++ b/cmd/podman/run.go @@ -56,6 +56,9 @@ func runCmd(c *cli.Context) error { rtc := runtime.GetConfig() newImage, err := runtime.ImageRuntime().New(c.Args()[0], rtc.SignaturePolicyPath, "", os.Stderr, nil, image.SigningOptions{}) + if err != nil { + return errors.Wrapf(err, "unable to find image") + } data, err := newImage.Inspect() if err != nil { diff --git a/libpod/image/image.go b/libpod/image/image.go index b08fa1acd..22268ac45 100644 --- a/libpod/image/image.go +++ b/libpod/image/image.go @@ -465,6 +465,9 @@ func (i *Image) ToImageRef() (types.Image, error) { // toImageRef returns an Image Reference type from an image func (i *Image) toImageRef() (types.Image, error) { + if i == nil { + return nil, errors.Errorf("cannot convert nil image to image reference") + } if i.imgRef == nil { ref, err := is.Transport.ParseStoreReference(i.imageruntime.store, "@"+i.ID()) if err != nil { |