Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bemayr committed Mar 11, 2020
1 parent f06411e commit 6d2a4b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Statecharts.NET.Core/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,15 @@ Service CreateServiceFromActivity(ActivityServiceDefinition service, string id)
return new TaskCompletionSource<object>().Task; // TODO: check if token and TaskCompletionSource have to be linked
});

return serviceDefinitions.Select((serviceDefinition, index) => serviceDefinition.Match(
return serviceDefinitions?.Select((serviceDefinition, index) => serviceDefinition.Match(
activity => CreateServiceFromActivity(activity, serviceDefinition.GetId(statenode.Id, index)),
task => new Service(serviceDefinition.GetId(statenode.Id, index), async cancellationToken =>
{
await task.Task(cancellationToken);
return default;
}),
dataTask => new Service(serviceDefinition.GetId(statenode.Id, index), dataTask.Task)));
dataTask => new Service(serviceDefinition.GetId(statenode.Id, index), dataTask.Task)))
?? Enumerable.Empty<Service>();
}
}

Expand Down

0 comments on commit 6d2a4b7

Please sign in to comment.