fix(docker): nil panic reading container names

This commit is contained in:
yusing
2025-12-17 23:17:11 +08:00
parent a754a2ed9f
commit 85b93be277

View File

@@ -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], "/")
} }