Try to avoid crashing when source fails to return pages

(cherry picked from commit 2f7f00c7a2)
This commit is contained in:
arkon
2021-05-22 11:41:10 -04:00
committed by Jobobby04
parent b3ddc1dfa3
commit 1389649553
@@ -98,6 +98,7 @@ class HttpPageLoader(
override fun getPages(): Observable<List<ReaderPage>> {
return Observable.fromCallable { chapterCache.getPageListFromCache(chapter.chapter) }
.onErrorResumeNext { source.fetchPageList(chapter.chapter) }
.onErrorReturn { emptyList() }
.map { pages ->
// SY -->
val rp = pages.mapIndexed { index, page ->