aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-08-30 14:52:29 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-08-30 14:52:29 -0400
commit0f23c7cfc1372ead03ab9b818e698441d4d53bd3 (patch)
tree3bade7be91c556ec752a7ab8598128fa14c234d8 /Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs
parent8de80d43ba496535aac89d9ec260d8dc2550169b (diff)
3.2.30.3
Diffstat (limited to 'Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs')
-rw-r--r--Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs b/Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs
index fc1cf4ed9..2233bf918 100644
--- a/Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs
+++ b/Emby.Server.Implementations/Services/StringMapTypeDeserializer.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Linq;
using System.Reflection;
namespace Emby.Server.Implementations.Services
@@ -64,11 +63,16 @@ namespace Emby.Server.Implementations.Services
if (instance == null)
instance = _CreateInstanceFn(type);
- foreach (var pair in keyValuePairs.Where(x => !string.IsNullOrEmpty(x.Value)))
+ foreach (var pair in keyValuePairs)
{
propertyName = pair.Key;
propertyTextValue = pair.Value;
+ if (string.IsNullOrEmpty(propertyTextValue))
+ {
+ continue;
+ }
+
if (!propertySetterMap.TryGetValue(propertyName, out propertySerializerEntry))
{
if (propertyName == "v")
@@ -115,7 +119,7 @@ namespace Emby.Server.Implementations.Services
{
public static Action<object, object> GetSetPropertyMethod(Type type, PropertyInfo propertyInfo)
{
- if (!propertyInfo.CanWrite || propertyInfo.GetIndexParameters().Any()) return null;
+ if (!propertyInfo.CanWrite || propertyInfo.GetIndexParameters().Length > 0) return null;
var setMethodInfo = propertyInfo.SetMethod;
return (instance, value) => setMethodInfo.Invoke(instance, new[] { value });