MGKomik: fix null pointer error (#10215)

This commit is contained in:
Luqman 2025-08-22 02:21:26 +07:00 committed by Draff
parent d62b06989b
commit 77b89cec80
Signed by: Draff
GPG Key ID: E8A89F3211677653
2 changed files with 6 additions and 14 deletions

View File

@ -3,7 +3,7 @@ ext {
extClass = '.MGKomik'
themePkg = 'madara'
baseUrl = 'https://id.mgkomik.cc'
overrideVersionCode = 17
overrideVersionCode = 18
isNsfw = false
}

View File

@ -45,22 +45,14 @@ class MGKomik : Madara(
// ================================== Popular ======================================
// overriding to change title selector and manga url selector
override fun popularMangaFromElement(element: Element): SManga {
val manga = SManga.create()
with(element) {
selectFirst("div.item-thumb a")!!.let {
manga.setUrlWithoutDomain(it.attr("abs:href"))
manga.title = it.attr("title")
}
selectFirst("img")?.let {
manga.thumbnail_url = imageFromElement(it)
return SManga.create().apply {
element.select("div.item-thumb a").let {
setUrlWithoutDomain(it.attr("abs:href"))
title = it.attr("title")
thumbnail_url = it.select("img").attr("abs:src")
}
}
return manga
}
// ================================ Chapters ================================