From b701821550dabadd1fb061d1a68741ec91b8774d Mon Sep 17 00:00:00 2001 From: arkon Date: Tue, 21 Dec 2021 08:47:01 -0500 Subject: [PATCH] Handle potentially missing sources list in extensions JSON Can happen in: - Unofficial repos - If the inspector breaks --- .../eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt index 5ac86b039..66ce857ce 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt @@ -81,7 +81,7 @@ internal class ExtensionGithubApi { versionCode = it.code, lang = it.lang, isNsfw = it.nsfw == 1, - sources = it.sources.toExtensionSources(), + sources = it.sources?.toExtensionSources() ?: emptyList(), apkName = it.apk, iconUrl = "${REPO_URL_PREFIX}icon/${it.apk.replace(".apk", ".png")}" ) @@ -114,7 +114,7 @@ private data class ExtensionJsonObject( val code: Long, val version: String, val nsfw: Int, - val sources: List, + val sources: List?, ) @Serializable