[Fix](index writer) fix core if docWriter nullptr when IndexWriter doFlush (#213)

This commit is contained in:
airborne12
2024-05-10 20:03:16 +08:00
committed by GitHub
parent d3de160871
commit 9e1fd04733

View File

@ -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