diff --git a/src/core/CLucene/index/IndexWriter.cpp b/src/core/CLucene/index/IndexWriter.cpp index e6a0887557c..e2e6ae7d73d 100644 --- a/src/core/CLucene/index/IndexWriter.cpp +++ b/src/core/CLucene/index/IndexWriter.cpp @@ -2048,6 +2048,11 @@ void IndexWriter::flush(bool triggerMerge, bool _flushDocStores) { bool IndexWriter::doFlush(bool _flushDocStores) { SCOPED_LOCK_MUTEX(THIS_LOCK) + // if docWriter is nullptr, maybe it's been flushed already + if (docWriter == nullptr) { + return false; + } + // Make sure no threads are actively adding a document // Returns true if docWriter is currently aborting, in