From 50ecf9eb43a432a051ef899f2efb433ed142f982 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 28 Sep 2022 14:53:06 +0800 Subject: [PATCH] fix(query): add null ptr check. --- source/libs/qworker/src/qworker.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/libs/qworker/src/qworker.c b/source/libs/qworker/src/qworker.c index ff311b709c..496252daea 100644 --- a/source/libs/qworker/src/qworker.c +++ b/source/libs/qworker/src/qworker.c @@ -635,7 +635,7 @@ _return: input.msgType = qwMsg->msgType; code = qwHandlePostPhaseEvents(QW_FPARAMS(), QW_PHASE_POST_QUERY, &input, NULL); - if (QW_EVENT_RECEIVED(ctx, QW_EVENT_FETCH)) { + if (ctx != NULL && QW_EVENT_RECEIVED(ctx, QW_EVENT_FETCH)) { void *rsp = NULL; int32_t dataLen = 0; SOutputData sOutput = {0}; @@ -660,8 +660,7 @@ _return: } } - - QW_RET(TSDB_CODE_SUCCESS); + QW_RET(code); } int32_t qwProcessCQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) {