Try to avoid crashing when source fails to return pages

This commit is contained in:
arkon 2021-05-22 11:41:10 -04:00
parent afd59eabbb
commit 2f7f00c7a2

View File

@ -87,6 +87,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 ->
pages.mapIndexed { index, page ->
// Don't trust sources and use our own indexing