mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 00:38:33 +02:00
fix(docker): nil panic reading container names
This commit is contained in:
@@ -31,6 +31,9 @@ func (c containerHelper) getAliases() []string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c containerHelper) getName() string {
|
func (c containerHelper) getName() string {
|
||||||
|
if len(c.Names) == 0 { // Why did it happen? Every container must have a name.
|
||||||
|
return ""
|
||||||
|
}
|
||||||
return strings.TrimPrefix(c.Names[0], "/")
|
return strings.TrimPrefix(c.Names[0], "/")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user