Merge pull request #1259 from h11128/checkSource_fix

修复不选择书源校验导致的crash
pull/1264/head 3.21.082409
kunfei 3 years ago committed by GitHub
commit 6957d89965
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt

@ -456,10 +456,10 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
}
private fun checkMessageRefreshJob(): Job {
val firstIndex = adapter.getItems().indexOf(adapter.selection.first())
val lastIndex = adapter.getItems().indexOf(adapter.selection.last())
val firstIndex = adapter.getItems().indexOf(adapter.selection.firstOrNull())
val lastIndex = adapter.getItems().indexOf(adapter.selection.lastOrNull())
var refreshCount = 0
Debug.isChecking = true
Debug.isChecking = firstIndex >= 0 && lastIndex >= 0
return async(start = CoroutineStart.LAZY) {
flow {
while (true) {

Loading…
Cancel
Save