mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-30 02:25:05 -05:00
Handle potentially missing sources list in extensions JSON
Can happen in: - Unofficial repos - If the inspector breaks
This commit is contained in:
parent
d022bf2673
commit
b701821550
1 changed files with 2 additions and 2 deletions
|
@ -81,7 +81,7 @@ internal class ExtensionGithubApi {
|
||||||
versionCode = it.code,
|
versionCode = it.code,
|
||||||
lang = it.lang,
|
lang = it.lang,
|
||||||
isNsfw = it.nsfw == 1,
|
isNsfw = it.nsfw == 1,
|
||||||
sources = it.sources.toExtensionSources(),
|
sources = it.sources?.toExtensionSources() ?: emptyList(),
|
||||||
apkName = it.apk,
|
apkName = it.apk,
|
||||||
iconUrl = "${REPO_URL_PREFIX}icon/${it.apk.replace(".apk", ".png")}"
|
iconUrl = "${REPO_URL_PREFIX}icon/${it.apk.replace(".apk", ".png")}"
|
||||||
)
|
)
|
||||||
|
@ -114,7 +114,7 @@ private data class ExtensionJsonObject(
|
||||||
val code: Long,
|
val code: Long,
|
||||||
val version: String,
|
val version: String,
|
||||||
val nsfw: Int,
|
val nsfw: Int,
|
||||||
val sources: List<ExtensionSourceJsonObject>,
|
val sources: List<ExtensionSourceJsonObject>?,
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
|
|
Loading…
Reference in a new issue