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 {