MET08THFTIRQS408M - v2.43.0 - SPC and APC Bug Fix

This commit is contained in:
2022-06-09 12:12:53 -07:00
parent 72a9f902bc
commit 09f85078f4
14 changed files with 117 additions and 167 deletions

View File

@ -427,16 +427,20 @@ public partial class ProcessData : IProcessData
_Details.AddRange(details);
}
#nullable enable
internal static List<Description> GetDescriptions(JsonElement[] jsonElements)
{
List<Description> results = new();
Description description;
Description? description;
JsonSerializerOptions jsonSerializerOptions = new() { NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString };
foreach (JsonElement jsonElement in jsonElements)
{
if (jsonElement.ValueKind != JsonValueKind.Object)
throw new Exception();
description = JsonSerializer.Deserialize<Description>(jsonElement.ToString(), jsonSerializerOptions);
if (description is null)
continue;
results.Add(description);
}
return results;