Skip to content

Commit

Permalink
filter: fix panic caused by nil pointer (#5922)
Browse files Browse the repository at this point in the history
ref #5638

filter: fix panic caused by nil pointer

Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
  • Loading branch information
ethercflow and ti-chi-bot committed Feb 7, 2023
1 parent b99dc1f commit 03081c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/schedule/filter/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ func (f *ruleWitnessFitFilter) Target(options *config.PersistOptions, store *cor
log.Warn("ruleWitnessFitFilter couldn't find peer on target Store", zap.Uint64("target-store", store.GetID()))
return statusStoreNotMatchRule
}
if targetPeer.Id == f.region.GetLeader().Id {
if targetPeer.Id == f.region.GetLeader().GetId() {
return statusStoreNotMatchRule
}
if f.oldFit.Replace(f.srcStore, store) {
Expand Down

0 comments on commit 03081c6

Please sign in to comment.