From 82fcea66023ec45f5979a5a3b3650a2651a3f2e5 Mon Sep 17 00:00:00 2001 From: Amy Palamountain Date: Sat, 1 Feb 2014 13:07:53 +1300 Subject: [PATCH] a work around for simple json support for empty root nodes --- Octokit/Http/JsonHttpPipeline.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Octokit/Http/JsonHttpPipeline.cs b/Octokit/Http/JsonHttpPipeline.cs index 81e0d7e2..3eea0d4e 100644 --- a/Octokit/Http/JsonHttpPipeline.cs +++ b/Octokit/Http/JsonHttpPipeline.cs @@ -44,8 +44,12 @@ namespace Octokit.Internal if (response.ContentType != null && response.ContentType.Equals("application/json", StringComparison.Ordinal)) { - var json = _serializer.Deserialize(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(response.Body); + response.BodyAsObject = json; + } } } }