From 54b85ad4670b8f403fffd196a150b9c2808a0f5c Mon Sep 17 00:00:00 2001 From: Mike <51273546+SnakeDoc83@users.noreply.github.com> Date: Sat, 16 May 2020 06:46:06 -0400 Subject: [PATCH] ReadManhwa - null details fix (#3181) --- src/en/readmanhwa/build.gradle | 2 +- .../tachiyomi/extension/en/readmanhwa/ReadManhwa.kt | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/en/readmanhwa/build.gradle b/src/en/readmanhwa/build.gradle index d09d5112c..0a2bb126e 100644 --- a/src/en/readmanhwa/build.gradle +++ b/src/en/readmanhwa/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: ReadManhwa' pkgNameSuffix = 'en.readmanhwa' extClass = '.ReadManhwa' - extVersionCode = 2 + extVersionCode = 3 libVersion = '1.2' } diff --git a/src/en/readmanhwa/src/eu/kanade/tachiyomi/extension/en/readmanhwa/ReadManhwa.kt b/src/en/readmanhwa/src/eu/kanade/tachiyomi/extension/en/readmanhwa/ReadManhwa.kt index 874656afc..5365050c9 100644 --- a/src/en/readmanhwa/src/eu/kanade/tachiyomi/extension/en/readmanhwa/ReadManhwa.kt +++ b/src/en/readmanhwa/src/eu/kanade/tachiyomi/extension/en/readmanhwa/ReadManhwa.kt @@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.extension.en.readmanhwa import com.github.salomonbrys.kotson.fromJson import com.github.salomonbrys.kotson.get import com.github.salomonbrys.kotson.int +import com.github.salomonbrys.kotson.nullString import com.github.salomonbrys.kotson.string import com.google.gson.Gson import com.google.gson.JsonArray @@ -108,12 +109,12 @@ class ReadManhwa : HttpSource() { val jsonObject = gson.fromJson(response.body()!!.string()) return SManga.create().apply { - description = jsonObject["description"].string - status = jsonObject["status"].string.toStatus() - thumbnail_url = jsonObject["image_url"].string - genre = jsonObject["tags"].asJsonArray.joinToString { it["name"].string } - artist = jsonObject["artists"].asJsonArray.joinToString { it["name"].string } - author = jsonObject["authors"].asJsonArray.joinToString { it["name"].string } + description = jsonObject["description"].nullString + status = jsonObject["status"].nullString.toStatus() + thumbnail_url = jsonObject["image_url"].nullString + genre = try { jsonObject["tags"].asJsonArray.joinToString { it["name"].string } } catch (_: Exception) { null } + artist = try { jsonObject["artists"].asJsonArray.joinToString { it["name"].string } } catch (_: Exception) { null } + author = try { jsonObject["authors"].asJsonArray.joinToString { it["name"].string } } catch (_: Exception) { null } } }