mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-08 06:42:21 -04:00
Fixed search functionality crash if any FT Xapian index not found in any zim file
This commit is contained in:
parent
824d40680f
commit
32807aa71b
@ -136,8 +136,13 @@ class ZimFileReader constructor(
|
|||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
fun searchSuggestions(prefix: String): Search =
|
fun searchSuggestions(prefix: String): Search? =
|
||||||
searcher.search(Query(prefix))
|
try {
|
||||||
|
searcher.search(Query(prefix))
|
||||||
|
} catch (ignore: Exception) {
|
||||||
|
// to handled the exception if there is no FT Xapian index found in the current zim file
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
fun getNextSuggestion(suggestionSearch: SuggestionSearch?): List<SearchSuggestion> {
|
fun getNextSuggestion(suggestionSearch: SuggestionSearch?): List<SearchSuggestion> {
|
||||||
val suggestionList = mutableListOf<SearchSuggestion>()
|
val suggestionList = mutableListOf<SearchSuggestion>()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user