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
commit f5d21c19db
1 changed files with 5 additions and 1 deletions

View File

@ -282,7 +282,11 @@ func getContainersJSON(c *context, w http.ResponseWriter, r *http.Request) {
} }
// Apply filters. // 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 continue
} }
if !filters.Match("id", container.Id) { if !filters.Match("id", container.Id) {