mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-04-29 22:27:31 +00:00
fix(config): 修复因 Maven 仓库配置中未包括 layout 属性导致解析错误的问题.
当 Maven 仓库采用 JsonObject 形式配置, 且未配置 "layout" 属性时, 将会引发 NPE, 该改动已修复该问题.
This commit is contained in:
parent
72e26bd677
commit
37c3275bb6
@ -151,7 +151,7 @@ internal object MavenRepositoryConfigSerializer
|
|||||||
context.deserialize<Proxy>(
|
context.deserialize<Proxy>(
|
||||||
json.getAsJsonObject("proxy"), Proxy::class.java
|
json.getAsJsonObject("proxy"), Proxy::class.java
|
||||||
) else null,
|
) else null,
|
||||||
layout = json.get("layout").asString ?: "default",
|
layout = json.get("layout")?.asString ?: "default",
|
||||||
enableReleases = json.get("enableReleases")?.asBoolean ?: true,
|
enableReleases = json.get("enableReleases")?.asBoolean ?: true,
|
||||||
enableSnapshots = json.get("enableSnapshots")?.asBoolean ?: true,
|
enableSnapshots = json.get("enableSnapshots")?.asBoolean ?: true,
|
||||||
authentication = if (json.has("authentication") && json.get("authentication").isJsonObject)
|
authentication = if (json.has("authentication") && json.get("authentication").isJsonObject)
|
||||||
|
Loading…
Reference in New Issue
Block a user