diff --git a/store/tikv/coprocessor.go b/store/tikv/coprocessor.go index ca6e2da4ace40..68ccb27e0f43a 100644 --- a/store/tikv/coprocessor.go +++ b/store/tikv/coprocessor.go @@ -765,6 +765,9 @@ func (worker *copIteratorWorker) handleCopStreamResult(bo *Backoffer, rpcCtx *RP } return worker.buildCopTasksFromRemain(bo, lastRange, task) } + if resp.Range == nil { + return nil, errors.New("streaming response should contain a range entry") + } lastRange = resp.Range } }