mirror of
https://github.com/talent-plan/tinykv.git
synced 2024-12-25 20:30:30 +08:00
fix nil pointer dereference in scheduler.go (#388)
This commit is contained in:
parent
c083988b20
commit
98a65f4d63
@ -224,6 +224,11 @@ func (m *MockSchedulerClient) AskSplit(ctx context.Context, region *metapb.Regio
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
|
||||
if curRegion == nil || curRegion.GetId() != region.GetId() {
|
||||
return resp, errors.New("region not found")
|
||||
}
|
||||
|
||||
if util.IsEpochStale(region.RegionEpoch, curRegion.RegionEpoch) {
|
||||
return resp, errors.New("epoch is stale")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user