From 0a4f58d160b756d19010c711f5f2041da6df8fd0 Mon Sep 17 00:00:00 2001 From: Rikki Tooley Date: Fri, 13 Sep 2013 19:19:16 +0100 Subject: [PATCH] Another fix to error detection... --- IF.Lastfm.Core/LastFm.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/IF.Lastfm.Core/LastFm.cs b/IF.Lastfm.Core/LastFm.cs index 4d06b65..89abb90 100644 --- a/IF.Lastfm.Core/LastFm.cs +++ b/IF.Lastfm.Core/LastFm.cs @@ -87,8 +87,20 @@ public static string FormatQueryParameters(IEnumerable + /// TODO see issue #5 + /// + /// String of JSON + /// Enum indicating the error, .None if there is no error + /// True when the JSON could be parsed and it didn't describe a known Last.Fm error. public static bool IsResponseValid(string json, out LastFmApiError error) { + if (string.IsNullOrWhiteSpace(json)) + { + error = LastFmApiError.Unknown; + return false; + } + JObject jo; try {