diff --git a/src/dbzero/core/collections/full_text/FT_IndexIterator.hpp b/src/dbzero/core/collections/full_text/FT_IndexIterator.hpp index b175fb69..9b2ef37b 100644 --- a/src/dbzero/core/collections/full_text/FT_IndexIterator.hpp +++ b/src/dbzero/core/collections/full_text/FT_IndexIterator.hpp @@ -292,10 +292,10 @@ namespace db0 void FT_IndexIterator::detach() { if (!this->m_is_detached) { - if (!this->m_iterator.is_end()) { - this->m_detach_key = *(this->m_iterator); - } else { + if (this->m_force_end || this->m_iterator.is_end()) { this->m_detach_key = {}; + } else { + this->m_detach_key = *(this->m_iterator); } this->m_iterator.reset(); this->m_is_detached = true;