From b7a592e13292158a743d8f361c1b0e1ddcc64039 Mon Sep 17 00:00:00 2001 From: Hector Dearman Date: Thu, 12 Dec 2024 18:31:10 +0000 Subject: [PATCH] [distribution] Ignore unknown keys (#310) --- .../emergetools/distribution/internal/DistributionInternal.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/distribution/distribution/src/main/kotlin/com/emergetools/distribution/internal/DistributionInternal.kt b/distribution/distribution/src/main/kotlin/com/emergetools/distribution/internal/DistributionInternal.kt index e82ffecc..86836963 100644 --- a/distribution/distribution/src/main/kotlin/com/emergetools/distribution/internal/DistributionInternal.kt +++ b/distribution/distribution/src/main/kotlin/com/emergetools/distribution/internal/DistributionInternal.kt @@ -65,7 +65,8 @@ internal data class CheckForUpdatesSuccessResult( private inline fun tryDecode(s: String): T? { return try { - Json.decodeFromString(s) + val json = Json { ignoreUnknownKeys = true } + json.decodeFromString(s) } catch (_: SerializationException) { null } catch (_: IllegalArgumentException) {