From 00625857097cafa762131de05671e36487d7c249 Mon Sep 17 00:00:00 2001 From: jdevillard Date: Fri, 9 Apr 2021 22:24:53 +0200 Subject: [PATCH] return object if it is already the good type --- .../Services/PlainObjectResultConverter.cs | 3 +++ 1 file changed, 3 insertions(+) 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); }