aboutsummaryrefslogtreecommitdiff
path: root/libpod/runtime_ctr.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r--libpod/runtime_ctr.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index 932bebdef..82a2fed19 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -165,9 +165,11 @@ func (r *Runtime) RemoveContainer(ctx context.Context, c *Container, force bool)
// Locks the container, but does not lock the runtime
func (r *Runtime) removeContainer(ctx context.Context, c *Container, force bool) error {
if !c.valid {
- // Container probably already removed
- // Or was never in the runtime to begin with
- return nil
+ if ok, _ := r.HasContainer(c.ID()); !ok {
+ // Container probably already removed
+ // Or was never in the runtime to begin with
+ return nil
+ }
}
// We need to lock the pod before we lock the container