diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index ac7081ba70..acc38ac8ed 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -698,8 +698,10 @@ void taos_stop_query(TAOS_RES *res) { tscKillSTableQuery(pSql); } else { if (pSql->cmd.command < TSDB_SQL_LOCAL) { - assert(pSql->pRpcCtx != NULL); - rpcCancelRequest(pSql->pRpcCtx); + if (pSql->pRpcCtx != NULL) { + rpcCancelRequest(pSql->pRpcCtx); + pSql->pRpcCtx = NULL; + } } }