(easy FIX)

This commit is contained in:
Chayapak 2023-10-12 10:10:38 +07:00
parent 482dca204f
commit 7269e8440d

View file

@ -88,7 +88,9 @@ public class SongLoaderThread extends Thread {
try {
if (isUrl) {
bytes = DownloadUtilities.DownloadToByteArray(songUrl, 5 * 1024 * 1024);
name = Paths.get(songUrl.toURI().getPath()).getFileName().toString();
final Path fileName = Paths.get(songUrl.toURI().getPath()).getFileName();
name = fileName == null ? "(root)" : fileName.toString();
} else {
bytes = Files.readAllBytes(songPath);
name = !isFolder ? fileName : songPath.getFileName().toString();