Skip to content

Commit 4059ae6

Browse files
committed
Merge pull request #295 from nicwise/patch-1
MonoTouch: Issue 293: JsonDeserialzer crashes on generic lists
2 parents d7acb61 + 374be47 commit 4059ae6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

RestSharp/Deserializers/JsonDeserializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ private IDictionary BuildDictionary(Type type, object parent)
198198
private IList BuildList(Type type, object parent)
199199
{
200200
var list = (IList)Activator.CreateInstance(type);
201-
var listType = type.GetInterfaces().First(x => x.GetGenericTypeDefinition() == typeof(IList<>));
201+
var listType = type.GetInterfaces().First(x => x.IsGenericType && x.GetGenericTypeDefinition() == typeof(IList<>));
202202
var itemType = listType.GetGenericArguments()[0];
203203

204204
if (parent is IList) {

0 commit comments

Comments
 (0)