diff --git a/daemon/list.go b/daemon/list.go index 6d86cd3b48..e55a38aa04 100644 --- a/daemon/list.go +++ b/daemon/list.go @@ -157,7 +157,9 @@ func (daemon *Daemon) filterByNameIDMatches(ctx *listContext) []*container.Conta cntrs := make([]*container.Container, 0, len(matches)) for id := range matches { - cntrs = append(cntrs, daemon.containers.Get(id)) + if c := daemon.containers.Get(id); c != nil { + cntrs = append(cntrs, c) + } } // Restore sort-order after filtering