Skip to content

Commit c93d6ea

Browse files
committed
improve isTrackIdValid check
1 parent 4d64626 commit c93d6ea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/de/labystudio/spotifyapi/platform/windows/api/spotify/SpotifyProcess.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ public long getAddressTrackId() {
212212
*/
213213
public boolean isTrackIdValid(String trackId) {
214214
for (char c : trackId.toCharArray()) {
215-
if (!Character.isLetterOrDigit(c)) {
215+
boolean isValidCharacter = c >= 'a' && c <= 'z'
216+
|| c >= 'A' && c <= 'Z'
217+
|| c >= '0' && c <= '9';
218+
if (!isValidCharacter) {
216219
return false;
217220
}
218221
}

0 commit comments

Comments
 (0)