mirror of https://github.com/docker/docs.git
fix the panic when "ps -a" with dead containers
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
This commit is contained in:
parent
d05c80c1ae
commit
3f6182c384
|
@ -282,9 +282,13 @@ func getContainersJSON(c *context, w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply filters.
|
// Apply filters.
|
||||||
|
if len(container.Names) > 0 {
|
||||||
if !filters.Match("name", strings.TrimPrefix(container.Names[0], "/")) {
|
if !filters.Match("name", strings.TrimPrefix(container.Names[0], "/")) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
} else if len(filters["name"]) > 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if !filters.Match("id", container.Id) {
|
if !filters.Match("id", container.Id) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue