1
0
mirror of https://github.com/docker/docs.git synced 2026-11-05 00:14:17 +03:00

Merge pull request #1465 from mountkin/fix-1436

fix the panic when "ps -a" with dead containers
This commit is contained in:
Victor Vieux
2015-11-30 14:54:47 -08:00

View File

@@ -282,7 +282,11 @@ func getContainersJSON(c *context, w http.ResponseWriter, r *http.Request) {
}
// Apply filters.
if !filters.Match("name", strings.TrimPrefix(container.Names[0], "/")) {
if len(container.Names) > 0 {
if !filters.Match("name", strings.TrimPrefix(container.Names[0], "/")) {
continue
}
} else if len(filters["name"]) > 0 {
continue
}
if !filters.Match("id", container.Id) {