diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 73374c7f77..387f97b8a4 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -2101,8 +2101,9 @@ TAOS_RES* taosQueryImpl(TAOS* taos, const char* sql, bool validateOnly) { taosAsyncQueryImpl(*(int64_t*)taos, sql, syncQueryFn, param, validateOnly); tsem_wait(¶m->sem); - - param->pRequest->syncQuery = true; + if (param->pRequest != NULL) { + param->pRequest->syncQuery = true; + } return param->pRequest; #else size_t sqlLen = strlen(sql);