Skip to content

Commit

Permalink
scheduler: get region nil panic
Browse files Browse the repository at this point in the history
  • Loading branch information
zexi committed May 11, 2020
1 parent 10f9188 commit d049ac9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/scheduler/data_manager/candidate_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d049ac9

Please sign in to comment.