From 09216d222dc20ce012abd8f77045c4b8824b3597 Mon Sep 17 00:00:00 2001 From: Alessandro Jean Date: Fri, 12 Feb 2021 17:38:55 -0300 Subject: [PATCH] Fix JSON error when title is null at Tsuki. (#5809) --- src/pt/tsukimangas/build.gradle | 2 +- .../kanade/tachiyomi/extension/pt/tsukimangas/TsukiMangas.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pt/tsukimangas/build.gradle b/src/pt/tsukimangas/build.gradle index 7ddf74e5f..93b9b9499 100644 --- a/src/pt/tsukimangas/build.gradle +++ b/src/pt/tsukimangas/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Tsuki Mangás' pkgNameSuffix = 'pt.tsukimangas' extClass = '.TsukiMangas' - extVersionCode = 9 + extVersionCode = 10 libVersion = '1.2' } diff --git a/src/pt/tsukimangas/src/eu/kanade/tachiyomi/extension/pt/tsukimangas/TsukiMangas.kt b/src/pt/tsukimangas/src/eu/kanade/tachiyomi/extension/pt/tsukimangas/TsukiMangas.kt index 2846185c5..d151c59c4 100644 --- a/src/pt/tsukimangas/src/eu/kanade/tachiyomi/extension/pt/tsukimangas/TsukiMangas.kt +++ b/src/pt/tsukimangas/src/eu/kanade/tachiyomi/extension/pt/tsukimangas/TsukiMangas.kt @@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.extension.pt.tsukimangas import com.github.salomonbrys.kotson.array import com.github.salomonbrys.kotson.int +import com.github.salomonbrys.kotson.nullString import com.github.salomonbrys.kotson.obj import com.github.salomonbrys.kotson.string import com.google.gson.JsonElement @@ -224,7 +225,7 @@ class TsukiMangas : HttpSource() { return obj["versions"].array.map { version -> SChapter.create().apply { name = "Cap. " + obj["number"].string + - (if (obj["title"].string.isNotEmpty()) " - " + obj["title"].string else "") + (if (!obj["title"].nullString.isNullOrEmpty()) " - " + obj["title"].string else "") chapter_number = obj["number"].string.toFloatOrNull() ?: -1f scanlator = version.obj["scans"].array .sortedBy { it.obj["scan"].obj["name"].string }