This commit is contained in:
tom5079
2020-09-04 07:51:55 +09:00
parent be64703d3c
commit 5ec67488eb
8 changed files with 44 additions and 34 deletions

View File

@@ -819,7 +819,9 @@ class MainActivity : AppCompatActivity() {
val currentQuery = query.split(" ").last().replace('_', ' ')
suggestionJob = CoroutineScope(Dispatchers.IO).launch {
val suggestions = ArrayList(getSuggestionsForQuery(currentQuery).map { TagSuggestion(it) })
val suggestions = kotlin.runCatching {
getSuggestionsForQuery(currentQuery).map { TagSuggestion(it) }.toMutableList()
}.getOrElse { mutableListOf() }
suggestions.filter {
val tag = "${it.n}:${it.s.replace(Regex("\\s"), "_")}"