Explorar el Código

Support IReadOnlyList in CommaDelimitedArrayModelBinder

crobibero hace 5 años
padre
commit
ef43878bbc
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      Jellyfin.Api/ModelBinders/CommaDelimitedArrayModelBinder.cs

+ 1 - 1
Jellyfin.Api/ModelBinders/CommaDelimitedArrayModelBinder.cs

@@ -15,7 +15,7 @@ namespace Jellyfin.Api.ModelBinders
         public Task BindModelAsync(ModelBindingContext bindingContext)
         {
             var valueProviderResult = bindingContext.ValueProvider.GetValue(bindingContext.ModelName);
-            var elementType = bindingContext.ModelType.GetElementType();
+            var elementType = bindingContext.ModelType.GetElementType() ?? bindingContext.ModelType.GenericTypeArguments[0];
             var converter = TypeDescriptor.GetConverter(elementType);
 
             if (valueProviderResult.Length > 1)