daemon: filterByNameIDMatches() fix error handling

Probably not critical, but we shouldn't use the data that's
returned if there's an error.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-07-08 13:07:19 +02:00
parent 8c9a240597
commit ddaba6d576
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -119,8 +119,11 @@ func (daemon *Daemon) filterByNameIDMatches(view *container.View, filter *listCo
// standard behavior of walking the entire container
// list from the daemon's in-memory store
all, err := view.All()
if err != nil {
return nil, err
}
sort.Sort(byCreatedDescending(all))
return all, err
return all, nil
}
// idSearch will determine if we limit name matching to the IDs