Skip to content

Commit

Permalink
[Fix](index writer) fix docWriter is null, when reenter close
Browse files Browse the repository at this point in the history
  • Loading branch information
airborne12 committed May 14, 2024
1 parent 9e1fd04 commit ddbb796
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/CLucene/index/IndexWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ddbb796

Please sign in to comment.