fix error on ls when container not defined

This commit is contained in:
Joel Elkins 2024-03-30 14:24:17 -05:00
parent 603d23bcf9
commit 03aa6c8d1b
No known key found for this signature in database
GPG Key ID: 133589DC38921AE2

View File

@ -526,6 +526,9 @@ func (c *Container) GetStats() *define.ContainerStats {
fmt.Fprintf(os.Stderr, "containers.stats returned error in the channel (%s): %s\n", c.Name, report.Error)
break
}
if len(report.Stats) == 0 {
return nil
}
return &report.Stats[0]
case <-time.After(250 * time.Millisecond):
break