Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rikkit committed Oct 20, 2014
2 parents a47d601 + 8f6a0db commit 150d50f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ public async override Task<PageResponse<LastArtist>> HandleResponse(HttpResponse
if (LastFm.IsResponseValid(json, out error) && response.IsSuccessStatusCode)
{
var jtoken = JsonConvert.DeserializeObject<JToken>(json).SelectToken("artists");
var artistsToken = jtoken.SelectToken("artists");
var itemsToken = artistsToken.SelectToken("artist");
var pageInfoToken = artistsToken.SelectToken("@attr");
var itemsToken = jtoken.SelectToken("artist");
var pageInfoToken = jtoken.SelectToken("@attr");

return PageResponse<LastArtist>.CreateSuccessResponse(itemsToken, pageInfoToken, LastArtist.ParseJToken);
}
Expand Down
3 changes: 2 additions & 1 deletion src/IF.Lastfm.Core/Objects/LastAlbum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ internal static LastAlbum ParseJToken(JToken token)
if (tagsToken != null)
{
var tagToken = tagsToken.SelectToken("tag");
a.TopTags = tagToken.Children().Select(LastTag.ParseJToken);
if (tagToken != null)
a.TopTags = tagToken.Children().Select(LastTag.ParseJToken);
}

a.ListenerCount = token.Value<int>("listeners");
Expand Down

0 comments on commit 150d50f

Please sign in to comment.