Issue 415: Null target type throws for array expressions (#416)

This commit is contained in:
Peter T. LaComb Jr 2020-10-22 03:55:46 -04:00 committed by GitHub
parent cc94472301
commit 8fb36ef6cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -100,7 +100,7 @@ namespace Elsa.Scripting.JavaScript.Services
if (value.IsArray())
{
var arrayInstance = value.AsArray();
var elementType = targetType.GetElementType() ?? targetType.GenericTypeArguments.First();
var elementType = targetType?.GetElementType() ?? targetType?.GenericTypeArguments?.First() ?? typeof(object);
if (elementType == typeof(byte))
{