mirror of https://github.com/kiwix/libkiwix.git
Fix crash searchbar's suggestions
The suggestion's list was filled without checking if the current suggestion was wrong which caused crash in this case.
This commit is contained in:
parent
15f7eaa400
commit
df76db4f47
|
@ -772,6 +772,9 @@ bool Reader::searchSuggestionsSmart(const string& prefix,
|
||||||
for (auto current = suggestionSearch->begin();
|
for (auto current = suggestionSearch->begin();
|
||||||
current != suggestionSearch->end();
|
current != suggestionSearch->end();
|
||||||
current++) {
|
current++) {
|
||||||
|
if (!current->good()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
std::vector<std::string> suggestion;
|
std::vector<std::string> suggestion;
|
||||||
suggestion.push_back(current->getTitle());
|
suggestion.push_back(current->getTitle());
|
||||||
suggestion.push_back("/A/" + current->getUrl());
|
suggestion.push_back("/A/" + current->getUrl());
|
||||||
|
|
Loading…
Reference in New Issue