Update flowchart JSON converter to handle undefined connections array
This commit is contained in:
parent
a11a4a0b45
commit
299f9248f0
|
|
@ -138,6 +138,9 @@ public class FlowchartJsonConverter : JsonConverter<Activities.Flowchart>
|
|||
|
||||
private static ICollection<Connection> DeserializeConnections(JsonElement connectionsElement, IDictionary<string, IActivity> activityDictionary, JsonSerializerOptions options)
|
||||
{
|
||||
if(connectionsElement.ValueKind == JsonValueKind.Undefined)
|
||||
return new List<Connection>();
|
||||
|
||||
// To not break existing workflow definitions, we need to support the old connection format.
|
||||
var useOldConnectionConverter = connectionsElement.EnumerateArray().Any(x => x.TryGetProperty("sourcePort", out var sourcePort) && sourcePort.ValueKind == JsonValueKind.String);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue