Merge pull request #26049 from crosbymichael/match-panic

Check for non-nil container after match
Upstream-commit: 054f681eb88af7657a88bf350590012592281137
Component: engine
This commit is contained in:
Tibor Vass
2016-08-26 11:45:34 -07:00
committed by GitHub

View File

@ -147,7 +147,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