From e4adb826a91f7071cef9706972c76c7c3fc15e5f Mon Sep 17 00:00:00 2001 From: airborne12 Date: Tue, 14 May 2024 16:43:36 +0800 Subject: [PATCH] [Fix](index writer) fix docWriter is null, when reenter close (#214) --- src/core/CLucene/index/IndexWriter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/CLucene/index/IndexWriter.cpp b/src/core/CLucene/index/IndexWriter.cpp index e2e6ae7d73d..8bc3a934553 100644 --- a/src/core/CLucene/index/IndexWriter.cpp +++ b/src/core/CLucene/index/IndexWriter.cpp @@ -535,7 +535,10 @@ void IndexWriter::closeInternal(bool waitForMerges) { try { if (infoStream != NULL) message(string("now flush at close")); - + // if docWriter is nullptr, maybe it's been flushed already + if (docWriter == nullptr) { + return; + } docWriter->close(); // Only allow a _CLNEW merge to be triggered if we are