Skip to content

Commit

Permalink
fix null error when apple music track has no artist (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 authored Oct 30, 2023
1 parent 575db18 commit b9c5117
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,12 @@ public AudioItem getSong(String id, String countryCode, boolean preview) throws
private List<AudioTrack> parseTracks(JsonBrowser json, boolean preview, Map<String, String> artistArtwork) {
var tracks = new ArrayList<AudioTrack>();
for (var value : json.get("data").values()) {
tracks.add(this.parseTrack(value, preview, artistArtwork.get(this.parseArtistId(value))));
var artistId = this.parseArtistId(value);
String artworkUrl = null;
if (artistId != null) {
artworkUrl = artistArtwork.get(artistId);
}
tracks.add(this.parseTrack(value, preview, artworkUrl));
}
return tracks;
}
Expand Down

0 comments on commit b9c5117

Please sign in to comment.