Skip to content

Commit

Permalink
remove compiler null warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kbilsted committed Feb 27, 2024
1 parent cc077b6 commit d780220
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Product/MicroWorkflow.Ioc.Autofac/AutofacAdaptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void RegisterWorkflowStep(string stepName, IStepImplementation instance)

public static class AutofacExtensions
{
public static void UseMicroWorkflow(this ContainerBuilder builder, WorkflowConfiguration config, params Assembly?[] assembliesToSearch)
public static void UseMicroWorkflow(this ContainerBuilder builder, WorkflowConfiguration config, params Assembly[] assembliesToSearch)
{
builder.RegisterInstance(config);
builder.RegisterInstance(config.LoggerConfiguration);
Expand Down
4 changes: 2 additions & 2 deletions src/Product/MicroWorkflow/ReflectionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public static Assembly[] FindRelevantAssemblies(Assembly[] assemblies)
.ToArray();

Assembly[] allAssembliesWithMicroWorkflowAsLast = new[] { Assembly.GetEntryAssembly() }
.Concat(ass.Where(x => !x.FullName.StartsWith("MicroWorkflow")))
.Concat(ass.Where(x => x.FullName.StartsWith("MicroWorkflow")))
.Concat(ass.Where(x => !x.FullName!.StartsWith("MicroWorkflow")))
.Concat(ass.Where(x => x.FullName!.StartsWith("MicroWorkflow")))
.Distinct()
.ToArray()!;

Expand Down
2 changes: 1 addition & 1 deletion src/Product/MicroWorkflow/Worker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public Worker(string workerName, IWorkflowLogger logger, IWorkflowIocContainer i
this.iocContainer = iocContainer;
this.engineRuntimeData = runtime;
this.workerConfig = config;
this.coordinator = coordinator;
this.coordinator = coordinator ?? throw new ArgumentNullException(nameof(coordinator));
}

enum WorkerRunStatus { Stop, Continue, NoWorkDone, Error }
Expand Down
4 changes: 2 additions & 2 deletions src/Product/MicroWorkflow/WorkflowEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public WorkflowEngine(
{
this.logger = logger;
this.iocContainer = iocContainer;
this.configuration = configuration;
this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));

Data = new WorkflowRuntimeData(iocContainer, formatter, logger, null);
Metrics = new WorkflowRuntimeMetrics(iocContainer);
Expand Down Expand Up @@ -74,7 +74,7 @@ void Init(WorkflowConfiguration configuration, string? engineName, CancellationT
configuration.WorkerConfig,
cts,
logger,
async () => new Worker(MakeWorkerName(), logger, iocContainer, Data, configuration.WorkerConfig, WorkerCoordinator).StartAsync(StoppingToken));
async () => await new Worker(MakeWorkerName(), logger, iocContainer, Data, configuration.WorkerConfig, WorkerCoordinator!).StartAsync(StoppingToken));

if (configuration.WorkerConfig.MinWorkerCount < 1)
throw new Exception("'MinWorkerCount' cannot be less than 1");
Expand Down
2 changes: 1 addition & 1 deletion src/createRelease.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cd C:\src\MicroWorkflow\src
copy ..\README.md .\Product\MicroWorkflow\README.md
dotnet build
dotnet pack --include-source -p:PackageVersion=1.3.2.0 -o:.\releases
dotnet pack --include-source -p:PackageVersion=1.5.0.0 -o:.\releases
cd releases
# dotnet nuget push *.symbols.nupkg -s https://api.nuget.org/v3/index.json --skip-duplicate --api-key MYKEYHERE
# del *
Expand Down

0 comments on commit d780220

Please sign in to comment.