From a9965a16ba403bf3d1dfcdd2181e4917d802ed3b Mon Sep 17 00:00:00 2001 From: jmir1 Date: Thu, 25 Nov 2021 18:49:45 +0100 Subject: [PATCH] fix crash in animecontroller --- .../java/eu/kanade/tachiyomi/ui/anime/AnimeController.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/anime/AnimeController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/anime/AnimeController.kt index 9bc9a73cb..027d01f15 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/anime/AnimeController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/anime/AnimeController.kt @@ -99,6 +99,7 @@ import eu.kanade.tachiyomi.util.episode.NoEpisodesException import eu.kanade.tachiyomi.util.hasCustomCover import eu.kanade.tachiyomi.util.lang.awaitSingle import eu.kanade.tachiyomi.util.lang.launchIO +import eu.kanade.tachiyomi.util.lang.launchUI import eu.kanade.tachiyomi.util.storage.getUriCompat import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.toShareIntent @@ -1054,9 +1055,9 @@ class AnimeController : } else videoUri ?: videoUrl val extIntent = getExternalIntent(pkgName, uri, episode, video, context) - try { startActivityForResult(extIntent, REQUEST_EXTERNAL) } catch (t: Throwable) { context.toast("Cannot open episode") } + try { startActivityForResult(extIntent, REQUEST_EXTERNAL) } catch (t: Throwable) { launchUI { context.toast("Cannot open episode") } } } else { - context.toast("Cannot open episode") + launchUI { context.toast("Cannot open episode") } } } else { startActivity(intent)