From a3f852430011f80b2c0169123f1abd60d33f4621 Mon Sep 17 00:00:00 2001 From: Cuong-Tran Date: Sun, 17 Nov 2024 20:15:00 +0700 Subject: [PATCH] SlimeRead: fix crash (#6088) * fix crash * bump version --- src/pt/slimeread/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/pt/slimeread/SlimeRead.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pt/slimeread/build.gradle b/src/pt/slimeread/build.gradle index a3721c18b..0fc2417c8 100644 --- a/src/pt/slimeread/build.gradle +++ b/src/pt/slimeread/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'SlimeRead' extClass = '.SlimeRead' - extVersionCode = 13 + extVersionCode = 14 isNsfw = true } diff --git a/src/pt/slimeread/src/eu/kanade/tachiyomi/extension/pt/slimeread/SlimeRead.kt b/src/pt/slimeread/src/eu/kanade/tachiyomi/extension/pt/slimeread/SlimeRead.kt index 1cc75c914..25866a271 100644 --- a/src/pt/slimeread/src/eu/kanade/tachiyomi/extension/pt/slimeread/SlimeRead.kt +++ b/src/pt/slimeread/src/eu/kanade/tachiyomi/extension/pt/slimeread/SlimeRead.kt @@ -110,12 +110,12 @@ class SlimeRead : HttpSource() { // Handling a large manga list return Observable.just(popularMangeCache!!) .map { mangaPage -> - val (mangas) = mangaPage + val mangas = mangaPage.mangas val pageSize = 15 currentSlice = (page - 1) * pageSize - val startIndex = min(mangas.size, currentSlice) + val startIndex = min(mangas.size - 1, currentSlice) val endIndex = min(mangas.size, currentSlice + pageSize) val slice = mangas.subList(startIndex, endIndex)