mirror of
https://github.com/criyle/go-sandbox.git
synced 2025-09-26 23:19:11 +08:00
Merge pull request #10 from BoYanZh/patch-1
fix(pkg/cgroup): nil pointer dereference
This commit is contained in:
commit
fa1ba2f855
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user