Skip to content

Commit 91e8457

Browse files
committed
Also pass the type of the object to the serializer
1 parent 9370086 commit 91e8457

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Neolution.Extensions.Caching.RedisHybrid/MsgPackSerializer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ public object Deserialize(Stream data, Type objectType)
3535
/// <param name="output">The output.</param>
3636
public void Serialize(object value, Stream output)
3737
{
38-
MessagePackSerializer.Serialize(output, value, this.options);
38+
if (value is null)
39+
{
40+
throw new ArgumentNullException(nameof(value));
41+
}
42+
43+
MessagePackSerializer.Serialize(value.GetType(), output, value, this.options);
3944
}
4045
}
4146
}

0 commit comments

Comments
 (0)