Skip to content

Commit

Permalink
Fixed NullPointerException
Browse files Browse the repository at this point in the history
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "com.sedmelluq.discord.lavaplayer.tools.JsonBrowser.as(java.lang.Class)" is null

womp womp deezer
  • Loading branch information
Nansess authored Sep 29, 2024
1 parent be72355 commit 7ac66d5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ private List<AudioTrack> parseTracks(JsonBrowser json, boolean preview) {
}

private AudioTrack parseTrack(JsonBrowser json, boolean preview) {
if (!json.get("readable").as(Boolean.class)) {
Boolean readable = json.get("readable").as(Boolean.class);
if (readable == null || !readable) {
throw new FriendlyException("This track is not readable. Available countries: " + json.get("available_countries").text(), FriendlyException.Severity.COMMON, null);
}
var id = json.get("id").text();
Expand Down

0 comments on commit 7ac66d5

Please sign in to comment.