Skip to content

Commit 4505c6a

Browse files
achvaicerhaacked
authored andcommitted
checking if type is System.Object but with a primitive value on deserialization
1 parent 6230c18 commit 4505c6a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

RestSharp/Deserializers/JsonDeserializer.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ private object ConvertValue(Type type, object value)
165165
type = type.GetGenericArguments()[0];
166166
}
167167

168+
if (type == typeof(System.Object) && value != null)
169+
{
170+
type = value.GetType();
171+
}
172+
168173
if (type.IsPrimitive)
169174
{
170175
// no primitives can contain quotes so we can safely remove them

0 commit comments

Comments
 (0)