diff --git a/app/build.gradle b/app/build.gradle index 45e8197a4..02ddc2b3b 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -281,7 +281,7 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" - final coroutines_version = '1.3.5' + final coroutines_version = '1.3.7' implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-reactive:$coroutines_version" diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaAllInOnePresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaAllInOnePresenter.kt index da88804cb..5308b8e4c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaAllInOnePresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaAllInOnePresenter.kt @@ -161,7 +161,7 @@ class MangaAllInOnePresenter( scope.launch(Dispatchers.IO) { var manga2: Manga? = null if (updateInfo) { - manga2 = db.getManga(manga.url, manga.source).executeAsBlocking()!! + manga2 = db.getManga(manga.url, manga.source).executeAsBlocking() updateChapters() updateChapterInfo() } @@ -190,7 +190,7 @@ class MangaAllInOnePresenter( val networkManga = try { source.fetchMangaDetails(manga).toBlocking().single() } catch (e: Exception) { - withContext(Dispatchers.Main) { controller.onFetchMangaError(e) } + controller.onFetchMangaError(e) return@launch } if (networkManga != null) { @@ -205,7 +205,7 @@ class MangaAllInOnePresenter( try { chapters = source.fetchChapterList(manga).toBlocking().single() } catch (e: Exception) { - withContext(Dispatchers.Main) { controller.onFetchMangaError(e) } + controller.onFetchMangaError(e) return@launch } } @@ -220,10 +220,8 @@ class MangaAllInOnePresenter( updateManga(updateInfo = false) controller.onFetchMangaDone() } - } catch (e: java.lang.Exception) { - withContext(Dispatchers.Main) { - controller.onFetchMangaError(e) - } + } catch (e: Exception) { + controller.onFetchMangaError(e) } } }