fix crash in animecontroller

This commit is contained in:
jmir1 2021-11-25 18:49:45 +01:00
parent 1a0f90793a
commit a9965a16ba

View file

@ -99,6 +99,7 @@ import eu.kanade.tachiyomi.util.episode.NoEpisodesException
import eu.kanade.tachiyomi.util.hasCustomCover import eu.kanade.tachiyomi.util.hasCustomCover
import eu.kanade.tachiyomi.util.lang.awaitSingle import eu.kanade.tachiyomi.util.lang.awaitSingle
import eu.kanade.tachiyomi.util.lang.launchIO 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.storage.getUriCompat
import eu.kanade.tachiyomi.util.system.logcat import eu.kanade.tachiyomi.util.system.logcat
import eu.kanade.tachiyomi.util.system.toShareIntent import eu.kanade.tachiyomi.util.system.toShareIntent
@ -1054,9 +1055,9 @@ class AnimeController :
} else videoUri ?: videoUrl } else videoUri ?: videoUrl
val extIntent = getExternalIntent(pkgName, uri, episode, video, context) 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 { } else {
context.toast("Cannot open episode") launchUI { context.toast("Cannot open episode") }
} }
} else { } else {
startActivity(intent) startActivity(intent)