Skip to content

Commit dbc92e0

Browse files
committed
Allow incomplete MIDI song definitions
1 parent 7361949 commit dbc92e0

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/dialog.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ function openfiledialog(path)
6464
cls()
6565
if current > 0
6666
args = split(songs[current][2])
67-
file = joinpath(path, lowercase(args[end]))
68-
opts = args[1:end-1]
69-
song = (file, opts)
67+
if length(args) > 0
68+
file = joinpath(path, lowercase(args[end]))
69+
opts = args[1:end-1]
70+
song = (file, opts)
71+
else
72+
song = ("", "")
73+
end
7074
else
7175
song = (nothing, nothing)
7276
end

src/tui.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ function main()
128128
if file == nothing
129129
break
130130
end
131-
mplay(file, device, opts)
131+
if length(file) > 0
132+
mplay(file, device, opts)
133+
end
132134
end
133135
else
134136
mplay(path, device)

0 commit comments

Comments
 (0)