mvSapphire / PowerPipe

A library for .NET that uses a fluent interface to construct advanced workflows with ease.
MIT License
174 stars 9 forks source link

Parallel step error #27

Closed Kentucky1988 closed 9 months ago

Kentucky1988 commented 9 months ago

If in parallel step added only .AddIf() that accepted false, we catch error on row:

Error message:

   System.NullReferenceException: Object reference not set to an instance of an object.
   at PowerPipe.Builder.Steps.AddIfStep1.ExecuteInternalAsync(TContext context, CancellationToken cancellationToken)
   at PowerPipe.Builder.Steps.InternalStep1.ExecuteAsync(TContext context, CancellationToken cancellationToken)
    End of inner exception stack trace
   at PowerPipe.Builder.Steps.InternalStep1.ExecuteAsync(TContext context, CancellationToken cancellationToken)
   at PowerPipe.Builder.Steps.InternalStep1.ExecuteAsync(TContext context, CancellationToken cancellationToken)
   at PowerPipe.Builder.Steps.ParallelStep2.<>c__DisplayClass3_0.<<ExecuteInternalAsync>b__0>d.MoveNext()

Code example:


.Parallel(b => b
    .AddIf<TestParallelStep>(_ => false)
    .AddIf<TestParallelStep>(_ => false)
    .AddIf<TestParallelStep>(_ => false))