Skip to content

Commit

Permalink
Merge pull request restsharp#295 from nicwise/patch-1
Browse files Browse the repository at this point in the history
MonoTouch: Issue 293: JsonDeserialzer crashes on generic lists
  • Loading branch information
petejohanson committed Jul 11, 2012
2 parents d7acb61 + 374be47 commit 4059ae6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RestSharp/Deserializers/JsonDeserializer.cs
Expand Up @@ -198,7 +198,7 @@ private IDictionary BuildDictionary(Type type, object parent)
private IList BuildList(Type type, object parent)
{
var list = (IList)Activator.CreateInstance(type);
var listType = type.GetInterfaces().First(x => x.GetGenericTypeDefinition() == typeof(IList<>));
var listType = type.GetInterfaces().First(x => x.IsGenericType && x.GetGenericTypeDefinition() == typeof(IList<>));
var itemType = listType.GetGenericArguments()[0];

if (parent is IList) {
Expand Down

0 comments on commit 4059ae6

Please sign in to comment.