diff --git a/src/util/src/tlog.c b/src/util/src/tlog.c index 232d10a7d07594c9c62cd13767c320da27af2a73..7b5dafcc8e771ba7d6e7b5691226bbc84a556ef8 100644 --- a/src/util/src/tlog.c +++ b/src/util/src/tlog.c @@ -131,7 +131,7 @@ void taosCloseLog() { taosStopLog(); //tsem_post(&(tsLogObj.logHandle->buffNotEmpty)); taosMsleep(MAX_LOG_INTERVAL/1000); - if (taosCheckPthreadValid(tsLogObj.logHandle->asyncThread)) { + if (tsLogObj.logHandle && taosCheckPthreadValid(tsLogObj.logHandle->asyncThread)) { pthread_join(tsLogObj.logHandle->asyncThread, NULL); } // In case that other threads still use log resources causing invalid write in valgrind