[TD-5474]<fix> fix runtime bug

This commit is contained in:
yihaoDeng 2021-07-22 14:38:08 +08:00
parent ff9748b473
commit 6a9d94fd97
1 changed files with 1 additions and 1 deletions

View File

@ -199,7 +199,7 @@ bool gcBuildQueryJson(HttpContext *pContext, HttpSqlCmd *cmd, TAOS_RES *result,
for (int32_t i = dataFields; i >= 0; i--) {
httpJsonItemToken(jsonBuf);
if (row[i] == NULL) {
if (row == NULL || i >= num_fields || row[i] == NULL) {
httpJsonOriginString(jsonBuf, "null", 4);
continue;
}