From 2f7f00c7a24d1081775a30430086f6c007a7e3b7 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 22 May 2021 11:41:10 -0400 Subject: [PATCH] Try to avoid crashing when source fails to return pages --- .../java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt index cdbe67d7a..3789bef34 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/HttpPageLoader.kt @@ -87,6 +87,7 @@ class HttpPageLoader( override fun getPages(): Observable> { return Observable.fromCallable { chapterCache.getPageListFromCache(chapter.chapter) } .onErrorResumeNext { source.fetchPageList(chapter.chapter) } + .onErrorReturn { emptyList() } .map { pages -> pages.mapIndexed { index, page -> // Don't trust sources and use our own indexing