Skip to content

Commit 79ad622

Browse files
committed
Throw if no audio string argument(s) passed.
1 parent 8f9c79e commit 79ad622

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/src/main/java/sogott/tones/Main.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ public static void main(String[] args) {
5151
System.out.println(
5252
"No audio output specified (audible playback disabled and no file output selected). Exiting...");
5353
} else {
54+
final List<String> operands = unmodifiableList(cliArgs.getArgList());
55+
56+
if(operands.isEmpty())
57+
{
58+
throw new ParseException("No audio String argument(s) passed.");
59+
}
60+
5461
final int bpm = cliArgs.getParsedOptionValue(CliOption.BPM.value(), BPM);
5562

5663
final int noteBeatValue = cliArgs.getParsedOptionValue(
@@ -63,8 +70,6 @@ public static void main(String[] args) {
6370

6471
final double wholeNoteDuration = beatDuration * noteBeatValue;
6572

66-
final List<String> operands = unmodifiableList(cliArgs.getArgList());
67-
6873
final record ValidAndInvalidOperands(List<Audio> valid, List<String> invalid) {
6974
}
7075

0 commit comments

Comments
 (0)