Merge pull request #10 from BoYanZh/patch-1

fix(pkg/cgroup): nil pointer dereference
This commit is contained in:
Yang Gao 2025-01-10 13:26:51 -05:00 committed by GitHub
commit fa1ba2f855
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -173,7 +173,7 @@ func randomBuild(pattern string, build func(string) (Cgroup, error)) (Cgroup, er
if err == nil {
return cg, nil
}
if errors.Is(err, os.ErrExist) || cg.Existing() {
if errors.Is(err, os.ErrExist) || (cg != nil && cg.Existing()) {
if try++; try < 10000 {
continue
}