diff --git a/src/query/src/qAggMain.c b/src/query/src/qAggMain.c index d43b5f45e8..ed66047bbe 100644 --- a/src/query/src/qAggMain.c +++ b/src/query/src/qAggMain.c @@ -1569,8 +1569,10 @@ static void stddev_dst_function(SQLFunctionCtx *pCtx) { avg = p->avg; } else { // todo opt performance by using iterator since the timestamp lsit is matched with the output result SResPair* p = bsearch(&pCtx->startTs, resList->pData, len, sizeof(SResPair), tsCompare); - assert(p != NULL); - + if (p == NULL) { + return; + } + avg = p->avg; }