From 7682c033ad63044bb355f15096b8cbc04d37145c Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 3 Oct 2023 02:39:57 +0800 Subject: [PATCH] fix(stream): add null check. --- source/libs/stream/src/streamMeta.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/libs/stream/src/streamMeta.c b/source/libs/stream/src/streamMeta.c index ca5c0045ec..aaffd9cfba 100644 --- a/source/libs/stream/src/streamMeta.c +++ b/source/libs/stream/src/streamMeta.c @@ -893,8 +893,11 @@ void metaHbToMnode(void* param, void* tmrId) { entry.inputRate = entry.inputQUsed*100.0/STREAM_TASK_INPUT_QUEUE_CAPACITY_IN_SIZE; entry.outputRate = entry.outputQUsed*100.0/STREAM_TASK_OUTPUT_QUEUE_CAPACITY_IN_SIZE; - entry.offset = walReaderGetCurrentVer((*pTask)->exec.pWalReader); - walReaderValidVersionRange((*pTask)->exec.pWalReader, &entry.verStart, &entry.verEnd); + + if ((*pTask)->exec.pWalReader != NULL) { + entry.offset = walReaderGetCurrentVer((*pTask)->exec.pWalReader); + walReaderValidVersionRange((*pTask)->exec.pWalReader, &entry.verStart, &entry.verEnd); + } taosArrayPush(hbMsg.pTaskStatus, &entry);