mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #6270 from zexi/hotfix/scheduler-region-panic
scheduler: get region nil panic
This commit is contained in:
@@ -217,7 +217,11 @@ func (cm *CandidateManager) GetCandidates(args CandidateGetArgs) ([]core.Candida
|
||||
|
||||
matchRegion := func(r core.Candidater, regionId string) bool {
|
||||
if regionId != "" {
|
||||
if r.Getter().Region().GetId() == regionId {
|
||||
region := r.Getter().Region()
|
||||
if region == nil {
|
||||
return false
|
||||
}
|
||||
if region.GetId() == regionId {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user