a work around for simple json support for empty root nodes

This commit is contained in:
Amy Palamountain
2014-02-01 13:07:53 +13:00
parent 021ef3d534
commit 82fcea6602
+6 -2
View File
@@ -44,8 +44,12 @@ namespace Octokit.Internal
if (response.ContentType != null && response.ContentType.Equals("application/json", StringComparison.Ordinal))
{
var json = _serializer.Deserialize<T>(response.Body);
response.BodyAsObject = json;
// simple json does not support the root node being empty. Will submit a pr but in the mean time....
if (response.Body != "{}")
{
var json = _serializer.Deserialize<T>(response.Body);
response.BodyAsObject = json;
}
}
}
}