diff --git a/SpotifyAPI/Web/SpotifyWebClient.cs b/SpotifyAPI/Web/SpotifyWebClient.cs index 5b43fd84..2375f05a 100644 --- a/SpotifyAPI/Web/SpotifyWebClient.cs +++ b/SpotifyAPI/Web/SpotifyWebClient.cs @@ -37,7 +37,7 @@ namespace SpotifyAPI.Web try { Tuple raw = DownloadRaw(url); - response = new Tuple(raw.Item1, _encoding.GetString(raw.Item2)); + response = new Tuple(raw.Item1, raw.Item2.Length > 0 ? _encoding.GetString(raw.Item2) : "{}"); } catch (WebException e) { @@ -58,7 +58,7 @@ namespace SpotifyAPI.Web try { Tuple raw = await DownloadRawAsync(url); - response = new Tuple(raw.Item1, _encoding.GetString(raw.Item2)); + response = new Tuple(raw.Item1, raw.Item2.Length > 0 ? _encoding.GetString(raw.Item2) : "{}"); } catch (WebException e) { @@ -118,7 +118,7 @@ namespace SpotifyAPI.Web try { Tuple data = UploadRaw(url, body, method); - response = new Tuple(data.Item1, _encoding.GetString(data.Item2)); + response = new Tuple(data.Item1, data.Item2.Length > 0 ? _encoding.GetString(data.Item2) : "{}"); } catch (WebException e) { @@ -139,7 +139,7 @@ namespace SpotifyAPI.Web try { Tuple data = await UploadRawAsync(url, body, method); - response = new Tuple(data.Item1, _encoding.GetString(data.Item2)); + response = new Tuple(data.Item1, data.Item2.Length > 0 ? _encoding.GetString(data.Item2) : "{}"); } catch (WebException e) {