Skip to content

Commit fa812cf

Browse files
committed
fixed build error in JsonDeserializer when building dictionaries
1 parent b28e7f8 commit fa812cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

RestSharp/Deserializers/JsonDeserializer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,16 @@ private IDictionary BuildDictionary(Type type, object parent)
100100
foreach (var child in (IDictionary<string, object>)parent)
101101
{
102102
var key = child.Key;
103-
object item;
103+
object item = null;
104104
if(valueType.GetGenericTypeDefinition() != typeof(List<>))
105105
{
106-
var item = ConvertValue(valueType, child.Value);
106+
item = ConvertValue(valueType, child.Value);
107107
}
108108
else
109109
{
110110
foreach (var element in (JsonArray)child.Value)
111111
{
112-
var item = ConvertValue(valueType, element);
112+
item = ConvertValue(valueType, element);
113113
}
114114
}
115115
dict.Add(key, item);

0 commit comments

Comments
 (0)