fix(query): add null pointer check.
This commit is contained in:
parent
102fdf2916
commit
75e0eaa53f
|
@ -204,7 +204,12 @@ static int32_t sortComparInit(SMsortComparParam* cmpParam, SArray* pSources, int
|
||||||
if (pHandle->type == SORT_SINGLESOURCE_SORT) {
|
if (pHandle->type == SORT_SINGLESOURCE_SORT) {
|
||||||
for (int32_t i = 0; i < cmpParam->numOfSources; ++i) {
|
for (int32_t i = 0; i < cmpParam->numOfSources; ++i) {
|
||||||
SSortSource* pSource = cmpParam->pSources[i];
|
SSortSource* pSource = cmpParam->pSources[i];
|
||||||
SPageInfo* pPgInfo = *(SPageInfo**)taosArrayGet(pSource->pageIdList, pSource->pageIndex);
|
|
||||||
|
if (taosArrayGetSize(pSource->pageIdList) == 0) {
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
SPageInfo* pPgInfo = *(SPageInfo**)taosArrayGet(pSource->pageIdList, pSource->pageIndex);
|
||||||
|
|
||||||
void* pPage = getBufPage(pHandle->pBuf, getPageId(pPgInfo));
|
void* pPage = getBufPage(pHandle->pBuf, getPageId(pPgInfo));
|
||||||
code = blockDataFromBuf(pSource->src.pBlock, pPage);
|
code = blockDataFromBuf(pSource->src.pBlock, pPage);
|
||||||
|
|
Loading…
Reference in New Issue