kunfei 4 anos atrás
pai
commit
9e62461ece

+ 4 - 1
app/src/main/java/io/legado/app/help/source/BookSourceExtensions.kt

@@ -77,7 +77,10 @@ suspend fun BookSource.clearExploreKindsCache() {
     }
     }
 }
 }
 
 
-fun BookSource.contains(word: String): Boolean {
+fun BookSource.contains(word: String?): Boolean {
+    if (word.isNullOrEmpty()) {
+        return true
+    }
     return bookSourceName.contains(word)
     return bookSourceName.contains(word)
             || bookSourceUrl.contains(word)
             || bookSourceUrl.contains(word)
             || bookSourceGroup?.contains(word) == true
             || bookSourceGroup?.contains(word) == true

+ 1 - 3
app/src/main/java/io/legado/app/ui/book/search/SearchScopeDialog.kt

@@ -117,9 +117,7 @@ class SearchScopeDialog : BaseDialogFragment(R.layout.dialog_search_scope) {
             withContext(IO) {
             withContext(IO) {
                 if (binding.rbSource.isChecked) {
                 if (binding.rbSource.isChecked) {
                     sources.filter { source ->
                     sources.filter { source ->
-                        screenText?.let { screenText ->
-                            source.contains(screenText)
-                        } ?: true
+                        source.contains(screenText)
                     }.let {
                     }.let {
                         screenSources.clear()
                         screenSources.clear()
                         screenSources.addAll(it)
                         screenSources.addAll(it)