From 7ac66d5f40f17fe904737f9af1cbbcce0a029912 Mon Sep 17 00:00:00 2001 From: Nansess <75940580+Nansess@users.noreply.github.com> Date: Sun, 29 Sep 2024 11:35:51 -0400 Subject: [PATCH] Fixed NullPointerException 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 --- .../topi314/lavasrc/deezer/DeezerAudioSourceManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/src/main/java/com/github/topi314/lavasrc/deezer/DeezerAudioSourceManager.java b/main/src/main/java/com/github/topi314/lavasrc/deezer/DeezerAudioSourceManager.java index 99c6762..f25878e 100644 --- a/main/src/main/java/com/github/topi314/lavasrc/deezer/DeezerAudioSourceManager.java +++ b/main/src/main/java/com/github/topi314/lavasrc/deezer/DeezerAudioSourceManager.java @@ -302,7 +302,8 @@ private List 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();