From 49b762f53c43633f8ef5e155f8ba6ebf556e9180 Mon Sep 17 00:00:00 2001 From: Danny Creations Date: Tue, 31 Oct 2023 12:12:00 +0700 Subject: [PATCH] fix(id/oploverz): unhandled error during search --- .../animeextension/id/oploverz/Oploverz.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/id/oploverz/src/eu/kanade/tachiyomi/animeextension/id/oploverz/Oploverz.kt b/src/id/oploverz/src/eu/kanade/tachiyomi/animeextension/id/oploverz/Oploverz.kt index 46f5c9c9c6..14650bbc93 100644 --- a/src/id/oploverz/src/eu/kanade/tachiyomi/animeextension/id/oploverz/Oploverz.kt +++ b/src/id/oploverz/src/eu/kanade/tachiyomi/animeextension/id/oploverz/Oploverz.kt @@ -164,11 +164,15 @@ class Oploverz : ConfigurableAnimeSource, AnimeHttpSource() { } private fun hasNextPage(document: Document): Boolean { - val pagination = document.selectFirst("div.pagination")!! - val totalPage = - pagination.selectFirst("span:nth-child(1)")!!.text().split(" ").last().toInt() - val currentPage = pagination.selectFirst("span.page-numbers.current")!!.text().toInt() - return currentPage > totalPage + try { + val pagination = document.selectFirst("div.pagination")!! + val totalPage = + pagination.selectFirst("span:nth-child(1)")!!.text().split(" ").last().toInt() + val currentPage = pagination.selectFirst("span.page-numbers.current")!!.text().toInt() + return currentPage > totalPage + } catch (_: Exception) { + return false + } } private fun parseStatus(status: String?): Int {