check for isBlank()

This commit is contained in:
Chayapak 2023-09-23 14:29:07 +07:00
parent 4642f14acd
commit 53691469a2

View file

@ -41,13 +41,17 @@ public class MidiConverter implements Converter {
if (mm.getType() == SET_TEMPO) { if (mm.getType() == SET_TEMPO) {
tempoEvents.add(event); tempoEvents.add(event);
} else if (mm.getType() == TRACK_NAME && isFirst) { } else if (mm.getType() == TRACK_NAME && isFirst) {
songName = new String(mm.getData()) + " (" + name + ")"; // i have put the ` (filename)` just in case the sequence is getting sus (like Track 2 for example) final String stringTitle = new String(mm.getData());
if (stringTitle.isBlank()) {
songName = stringTitle + " (" + name + ")"; // i have put the ` (filename)` just in case the sequence is getting sus (like Track 2 for example)
isFirst = false; isFirst = false;
} }
} }
} }
} }
}
final Song song = new Song(name, bot, songName, null, null, null, false); final Song song = new Song(name, bot, songName, null, null, null, false);