From 53b84a884c9981b0f98dd49633f20a3c55983162 Mon Sep 17 00:00:00 2001 From: Liam Date: Fri, 28 Jun 2024 03:13:54 +0100 Subject: [PATCH] missing code param err --- src/main/java/cc/fascinated/bat/service/SpotifyService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/cc/fascinated/bat/service/SpotifyService.java b/src/main/java/cc/fascinated/bat/service/SpotifyService.java index 1d81239..0d0bfbd 100644 --- a/src/main/java/cc/fascinated/bat/service/SpotifyService.java +++ b/src/main/java/cc/fascinated/bat/service/SpotifyService.java @@ -146,10 +146,13 @@ public class SpotifyService { */ @SneakyThrows public String authorize(String code) { + if (code == null) { + return "Missing code param"; + } AuthorizationCodeCredentials credentials = spotifyApi.authorizationCode(code).build().execute(); String key = StringUtils.randomString(16); accessToken.put(key, credentials); - return "Authorization key: " + key; + return "Authorization Key: " + key; } /**