diff --git a/cmd/podman/images/rm.go b/cmd/podman/images/rm.go index 42ebd17679..c053b9dda0 100644 --- a/cmd/podman/images/rm.go +++ b/cmd/podman/images/rm.go @@ -87,7 +87,7 @@ func rm(_ *cobra.Command, args []string) error { } } } - if len(rmErrors) > 0 { + if len(rmErrors) > 0 && report != nil { registry.SetExitCode(report.ExitCode) }