From fef3db996ae290387794f36666654766953baeca Mon Sep 17 00:00:00 2001 From: codex Date: Fri, 31 Jul 2026 15:42:31 +0300 Subject: [PATCH] fix: parse string pilot configuration enums --- Launcher.Next.Core/NextPilot.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Launcher.Next.Core/NextPilot.cs b/Launcher.Next.Core/NextPilot.cs index c61a7de..de8cf76 100644 --- a/Launcher.Next.Core/NextPilot.cs +++ b/Launcher.Next.Core/NextPilot.cs @@ -26,7 +26,7 @@ public static class PilotConfigurationParser public static PilotConfigurationLoadResult Parse(string? json) { if (string.IsNullOrWhiteSpace(json)) return new(PilotLocalConfiguration.SafeDefault, []); - try { var config = JsonSerializer.Deserialize(json, new JsonSerializerOptions { PropertyNameCaseInsensitive = true, UnmappedMemberHandling = JsonUnmappedMemberHandling.Disallow }); + try { var options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true, UnmappedMemberHandling = JsonUnmappedMemberHandling.Disallow }; options.Converters.Add(new JsonStringEnumConverter()); var config = JsonSerializer.Deserialize(json, options); if (config is null || config.SchemaVersion != 1) return new(PilotLocalConfiguration.SafeDefault, ["PILOT_CONFIGURATION_INVALID"]); return new(config, []); } catch (JsonException) { return new(PilotLocalConfiguration.SafeDefault, ["PILOT_CONFIGURATION_INVALID"]); }