Fixed exception when HttpClient requests are cancelled and return empty strings

This commit is contained in:
Rikki Tooley 2013-09-11 03:18:51 +01:00
parent fc42d1b34c
commit 015362fc81

View File

@ -90,7 +90,7 @@ public static string FormatQueryParameters(IEnumerable<KeyValuePair<string, stri
public static bool IsResponseValid(string json, out LastFmApiError error)
{
// hmmm
if (!json.Contains("error"))
if (json.Length > 1 && !json.Contains("error"))
{
error = LastFmApiError.None;
return true;