Przeglądaj źródła

Fixed Serialization issue with InList Filters

frogsoftware 1 rok temu
rodzic
commit
9d7d4ffa7d
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      InABox.Core/Filter.cs

+ 5 - 1
InABox.Core/Filter.cs

@@ -1503,7 +1503,11 @@ namespace InABox.Core
         {
             Expression = reader.DeserialiseExpression(typeof(T));
             Operator = (Operator)reader.ReadByte();
-            Value = CoreUtils.ChangeType(DeserializeValue(reader), Expression.Type);
+            var val = DeserializeValue(reader);
+            var type = (Operator == Operator.InList || Operator == Operator.NotInList)
+                ? Expression.Type.MakeArrayType()
+                : Expression.Type;
+            Value = CoreUtils.ChangeType(val, type);
 
             Ands.Clear();
             var nAnds = reader.ReadInt32();