mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-14 21:18:56 +01:00
Fix exception thrown when Batoto search is empty
This commit is contained in:
@@ -36,9 +36,11 @@ class CatalogueAdapter(val fragment: CatalogueFragment) : FlexibleAdapter<Catalo
|
||||
* @param list the list to add.
|
||||
*/
|
||||
fun addItems(list: List<Manga>) {
|
||||
val sizeBeforeAdding = mItems.size
|
||||
mItems.addAll(list)
|
||||
notifyItemRangeInserted(sizeBeforeAdding, list.size)
|
||||
if (list.isNotEmpty()) {
|
||||
val sizeBeforeAdding = mItems.size
|
||||
mItems.addAll(list)
|
||||
notifyItemRangeInserted(sizeBeforeAdding, list.size)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -229,7 +229,6 @@ class CataloguePresenter : BasePresenter<CatalogueFragment>() {
|
||||
source.fetchSearchManga(nextMangasPage, query)
|
||||
|
||||
return observable.subscribeOn(Schedulers.io())
|
||||
.doOnNext { if (it.mangas.isEmpty()) throw Exception("Empty page") }
|
||||
.doOnNext { lastMangasPage = it }
|
||||
.flatMap { Observable.from(it.mangas) }
|
||||
.map { networkToLocalManga(it) }
|
||||
|
||||
Reference in New Issue
Block a user