解决文件内容搜索详情页获取数据时偶现的崩溃问题

This commit is contained in:
iaom 2022-11-30 16:19:18 +08:00
parent 888aca24eb
commit 83f1b904ad
1 changed files with 4 additions and 0 deletions

View File

@ -339,6 +339,10 @@ int FileContentSearch::getResult(Xapian::MSet &result, std::string &keyWord) {
for(const QString& wordTobeFound : words) { for(const QString& wordTobeFound : words) {
std::string term = wordTobeFound.toStdString(); std::string term = wordTobeFound.toStdString();
termIterator.skip_to(term); termIterator.skip_to(term);
if(termIterator == doc.termlist_end()) {
termIterator = doc.termlist_begin();
continue;
}
if(term == *termIterator) { if(term == *termIterator) {
break; break;
} else { } else {