prevent image prune panic

Signed-off-by: Alfred Landrum <alfred.landrum@docker.com>
Upstream-commit: 32da2a4234c5c68ff466dc1afc91ba98dbbe199a
Component: engine
This commit is contained in:
Alfred Landrum
2017-05-26 12:54:33 -07:00
parent 933e100f5e
commit f35cfc66e5

View File

@ -216,7 +216,7 @@ func (daemon *Daemon) ImagesPrune(ctx context.Context, pruneFilters filters.Args
if !until.IsZero() && img.Created.After(until) {
continue
}
if !matchLabels(pruneFilters, img.Config.Labels) {
if img.Config != nil && !matchLabels(pruneFilters, img.Config.Labels) {
continue
}
topImages[id] = img