diff --git a/source/libs/stream/src/streamState.c b/source/libs/stream/src/streamState.c index 9e49ae9e97..7fa19a9860 100644 --- a/source/libs/stream/src/streamState.c +++ b/source/libs/stream/src/streamState.c @@ -256,8 +256,10 @@ int32_t streamStateBegin(SStreamState* pState) { int32_t streamStateCommit(SStreamState* pState) { #ifdef USE_ROCKSDB - SStreamSnapshot* pShot = getSnapshot(pState->pFileState); - flushSnapshot(pState->pFileState, pShot, true); + if (pState->pFileState) { + SStreamSnapshot* pShot = getSnapshot(pState->pFileState); + flushSnapshot(pState->pFileState, pShot, true); + } return 0; #else if (tdbCommit(pState->pTdbState->db, pState->pTdbState->txn) < 0) {