Fix type cast issue when evaluating JS expressions with no specialized type

This commit is contained in:
Sipke Schoorstra 2021-03-19 12:21:04 +01:00
parent ac32034d00
commit 63aef00415

View file

@ -53,6 +53,9 @@ namespace Elsa.Scripting.JavaScript.Services
var json = JsonConvert.SerializeObject(returnValue);
return JsonConvert.DeserializeObject(json, returnType);
}
if (returnType == typeof(object))
return returnValue;
return Convert.ChangeType(returnValue, returnType);
}