diff --git a/src/scripting/Elsa.Scripting.JavaScript/Services/PlainObjectResultConverter.cs b/src/scripting/Elsa.Scripting.JavaScript/Services/PlainObjectResultConverter.cs index bf883bbe3..4ba9638df 100644 --- a/src/scripting/Elsa.Scripting.JavaScript/Services/PlainObjectResultConverter.cs +++ b/src/scripting/Elsa.Scripting.JavaScript/Services/PlainObjectResultConverter.cs @@ -11,6 +11,9 @@ namespace Elsa.Scripting.JavaScript.Services if(desiredType == typeof(object)) return evaluationResult; + if (evaluationResult.GetType() == desiredType || desiredType.IsAssignableFrom(evaluationResult.GetType())) + return evaluationResult; + return wrapped.ConvertToDesiredType(evaluationResult, desiredType); }