Fix JSON parsing exception not handled in Madara. (#8721)
This commit is contained in:
parent
8a52a4db06
commit
179a1f1159
|
@ -596,11 +596,12 @@ abstract class Madara(
|
||||||
val wpMangaData = document.select("script#wp-manga-js-extra").firstOrNull()
|
val wpMangaData = document.select("script#wp-manga-js-extra").firstOrNull()
|
||||||
?.data() ?: return null
|
?.data() ?: return null
|
||||||
|
|
||||||
val wpManga = wpMangaData
|
val wpMangaInfo = wpMangaData
|
||||||
.substringAfter("var manga = ")
|
.substringAfter("var manga = ")
|
||||||
.substringBeforeLast(";")
|
.substringBeforeLast(";")
|
||||||
.let { json.parseToJsonElement(it) }
|
|
||||||
.jsonObject
|
val wpManga = runCatching { json.parseToJsonElement(wpMangaInfo).jsonObject }
|
||||||
|
.getOrNull() ?: return null
|
||||||
|
|
||||||
if (wpManga["enable_manga_view"]?.jsonPrimitive?.content == "1") {
|
if (wpManga["enable_manga_view"]?.jsonPrimitive?.content == "1") {
|
||||||
val formBuilder = FormBody.Builder()
|
val formBuilder = FormBody.Builder()
|
||||||
|
|
|
@ -10,7 +10,7 @@ class MadaraGenerator : ThemeSourceGenerator {
|
||||||
|
|
||||||
override val themeClass = "Madara"
|
override val themeClass = "Madara"
|
||||||
|
|
||||||
override val baseVersionCode: Int = 10
|
override val baseVersionCode: Int = 11
|
||||||
|
|
||||||
override val sources = listOf(
|
override val sources = listOf(
|
||||||
MultiLang("Leviatan Scans", "https://leviatanscans.com", listOf("en", "es"), className = "LeviatanScansFactory", overrideVersionCode = 6),
|
MultiLang("Leviatan Scans", "https://leviatanscans.com", listOf("en", "es"), className = "LeviatanScansFactory", overrideVersionCode = 6),
|
||||||
|
|
Loading…
Reference in New Issue