Fix workflow context type nullability
This commit is contained in:
parent
c1f827cfee
commit
18f45fe241
|
|
@ -13,7 +13,7 @@ namespace Elsa.Services.Models
|
|||
public WorkflowExecutionContext WorkflowExecutionContext { get; }
|
||||
public IWorkflowBlueprint WorkflowBlueprint => WorkflowExecutionContext.WorkflowBlueprint;
|
||||
public WorkflowInstance WorkflowInstance => WorkflowExecutionContext.WorkflowInstance;
|
||||
public Type ContextType => WorkflowBlueprint.ContextOptions!.ContextType;
|
||||
public Type? ContextType => WorkflowBlueprint.ContextOptions?.ContextType;
|
||||
public string ContextId => WorkflowInstance.ContextId!;
|
||||
}
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@ namespace Elsa.Services
|
|||
|
||||
public async ValueTask<object?> LoadContext(LoadWorkflowContext context, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var provider = GetRefresher(context.ContextType);
|
||||
var provider = context.ContextType != null ? GetRefresher(context.ContextType) : null;
|
||||
return provider == null ? null : await provider.LoadAsync(context, cancellationToken);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue