From 3df98d576ebfc183a50b6c458f655a8d272c4b7a Mon Sep 17 00:00:00 2001 From: arkon Date: Tue, 29 Dec 2020 09:21:18 -0500 Subject: [PATCH] Fix crash on updating trackers after reading with no network (closes #4207) --- .../java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt index ffc048e80..b5d8ada42 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt @@ -673,14 +673,18 @@ class ReaderPresenter( // We want these to execute even if the presenter is destroyed and leaks // for a while. The view can still be garbage collected. async { - service.update(track) - db.insertTrack(track).await() + runCatching { + service.update(track) + db.insertTrack(track).await() + } } } else { null } } .awaitAll() + .filter { it.isFailure } + .forEach { it.exceptionOrNull()?.let { e -> Timber.w(e) } } } }