瀏覽代碼

Support IReadOnlyList in CommaDelimitedArrayModelBinder

crobibero 4 年之前
父節點
當前提交
ef43878bbc
共有 1 個文件被更改,包括 1 次插入1 次删除
  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)