kunfei 4 лет назад
Родитель
Сommit
22e4c71fe9
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      app/src/main/java/io/legado/app/help/coroutine/Coroutine.kt

+ 3 - 1
app/src/main/java/io/legado/app/help/coroutine/Coroutine.kt

@@ -146,7 +146,9 @@ class Coroutine<T>(
                 success?.let { dispatchCallback(this, value, it) }
             } catch (e: Throwable) {
                 e.printOnDebug()
-                if (e is ActivelyCancelException) this@Coroutine.cancel()
+                if (e is CancellationException && e !is ActivelyCancelException) {
+                    this@Coroutine.cancel()
+                }
                 if (e is CancellationException && e !is TimeoutCancellationException) {
                     return@launch
                 }