From e7714533b1471c9f3750eddf0a5b106ea7533b5d Mon Sep 17 00:00:00 2001 From: Secozzi Date: Thu, 31 Oct 2024 12:05:58 +0100 Subject: [PATCH] Fix app crash when removing tracked entry from tracker Co-authored-by: Cuong-Tran <16017808+cuong-tran@users.noreply.github.com> --- .../ui/entries/anime/track/AnimeTrackInfoDialog.kt | 6 +++++- .../ui/entries/manga/track/MangaTrackInfoDialog.kt | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/track/AnimeTrackInfoDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/track/AnimeTrackInfoDialog.kt index 6625d25bf..1fa6a5630 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/track/AnimeTrackInfoDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/anime/track/AnimeTrackInfoDialog.kt @@ -847,7 +847,11 @@ private data class TrackerAnimeRemoveScreen( fun deleteAnimeFromService() { screenModelScope.launchNonCancellable { - (tracker as DeletableAnimeTracker).delete(track) + try { + (tracker as DeletableAnimeTracker).delete(track) + } catch (e: Exception) { + logcat(LogPriority.ERROR, e) { "Failed to delete anime entry from service" } + } } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/track/MangaTrackInfoDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/track/MangaTrackInfoDialog.kt index 438b5dd32..c794030c7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/track/MangaTrackInfoDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/entries/manga/track/MangaTrackInfoDialog.kt @@ -847,7 +847,11 @@ private data class TrackerMangaRemoveScreen( fun deleteMangaFromService() { screenModelScope.launchNonCancellable { - (tracker as DeletableMangaTracker).delete(track) + try { + (tracker as DeletableMangaTracker).delete(track) + } catch (e: Exception) { + logcat(LogPriority.ERROR, e) { "Failed to delete manga entry from service" } + } } }