From ab390ecee11561ac3e0083d787442bb28ec3a7c8 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 26 Apr 2022 14:10:25 +0800 Subject: [PATCH] fix(query): add a null ptr check --- source/libs/executor/src/executorimpl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index d8b09e239d..123cced011 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -4678,10 +4678,10 @@ _error: int32_t getTableScanOrder(SOperatorInfo* pOperator) { if (pOperator->operatorType != QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN) { - if (pOperator->pDownstream[0] != NULL) { - return getTableScanOrder(pOperator->pDownstream[0]); - } else { + if (pOperator->pDownstream == NULL || pOperator->pDownstream[0] == NULL) { return TSDB_ORDER_ASC; + } else { + return getTableScanOrder(pOperator->pDownstream[0]); } }