From 33253cbb54475e08f1a4ff12abbc9d0a8e5734a6 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 5 Jan 2024 18:13:35 +0800 Subject: [PATCH] fix(stream): add null ptr check. --- source/libs/stream/src/streamExec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/libs/stream/src/streamExec.c b/source/libs/stream/src/streamExec.c index d83d99f10f..5c38b24a77 100644 --- a/source/libs/stream/src/streamExec.c +++ b/source/libs/stream/src/streamExec.c @@ -689,8 +689,12 @@ bool streamTaskIsIdle(const SStreamTask* pTask) { bool streamTaskReadyToRun(const SStreamTask* pTask, char** pStatus) { SStreamTaskState* pState = streamTaskGetStatus(pTask); + ETaskStatus st = pState->state; - *pStatus = pState->name; + if (pStatus != NULL) { + *pStatus = pState->name; + } + return (st == TASK_STATUS__READY || st == TASK_STATUS__SCAN_HISTORY || st == TASK_STATUS__CK); }