Improve error handling in JavaScript Evaluator
Introduces a safeguard in the JintJavaScriptEvaluator in the Elsa.JavaScript module. This checks whether a workflow execution context can be retrieved before trying to get its input definitions. This prevents potential errors when the context isn't available.
This commit is contained in:
parent
838e26eb2b
commit
7560bfa756
|
|
@ -132,7 +132,11 @@ public class JintJavaScriptEvaluator : IJavaScriptEvaluator
|
|||
return;
|
||||
|
||||
var inputs = context.GetWorkflowInputs().ToDictionary(x => x.Name);
|
||||
var inputDefinitions = context.GetWorkflowExecutionContext().Workflow.Inputs;
|
||||
|
||||
if (!context.TryGetWorkflowExecutionContext(out var workflowExecutionContext))
|
||||
return;
|
||||
|
||||
var inputDefinitions = workflowExecutionContext.Workflow.Inputs;
|
||||
|
||||
foreach (var inputDefinition in inputDefinitions)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue