fix panic error when docker stats a stopped container

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
Qiang Huang
2015-03-16 19:55:34 +08:00
parent bc7d1d6ef3
commit 8dc5791f73
2 changed files with 30 additions and 1 deletions
+3
View File
@@ -315,6 +315,9 @@ func (d *driver) Clean(id string) error {
func (d *driver) Stats(id string) (*execdriver.ResourceStats, error) {
c := d.activeContainers[id]
if c == nil {
return nil, execdriver.ErrNotRunning
}
now := time.Now()
stats, err := c.Stats()
if err != nil {