FdoSecrets: fix all exposed entries are returned if search with empty terms

This commit is contained in:
Peifeng Yu 2019-12-11 16:52:11 -05:00 committed by Jonathan White
parent 8459a216a5
commit 3ffeab4c41

View File

@ -242,6 +242,11 @@ namespace FdoSecrets
terms << attributeToTerm(it.key(), it.value()); terms << attributeToTerm(it.key(), it.value());
} }
// empty terms causes EntrySearcher returns everything
if (terms.isEmpty()) {
return QList<Item*>{};
}
QList<Item*> items; QList<Item*> items;
const auto foundEntries = EntrySearcher().search(terms, m_exposedGroup); const auto foundEntries = EntrySearcher().search(terms, m_exposedGroup);
items.reserve(foundEntries.size()); items.reserve(foundEntries.size());