Panic when toggle printing the notes with no MIDI input source
mzacho opened this issue Β· comments
Martin Zacho commented
Just did a fresh install of Melrose on Darwin, when playing around a little bit I somehow made the program panic:
π :m e
MidiInCore::openPort: no MIDI input sources found!
melrose sings bye!
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x8 pc=0x1003b8530]
goroutine 1 [running]:
github.com/emicklei/melrose/midi.(*DeviceRegistry).HandleSetting(0x1400011d2c0, {0x100435dd9, 0xb}, {0x14000125c88, 0x0, 0x0})
/Users/mazg/z-music/melrose/midi/cli.go:29 +0x5c0
github.com/emicklei/melrose/midi.(*DeviceRegistry).Command(0x1400011d2c0, {0x140000ae1f0, 0x1, 0x1})
/Users/mazg/z-music/melrose/midi/cli.go:117 +0x450
github.com/emicklei/melrose/ui/cli.handleMIDISetting({0x10057dc00, 0x1400015a440}, {0x140000ae1f0, 0x1, 0x1})
/Users/mazg/z-music/melrose/ui/cli/command.go:53 +0x5c
github.com/emicklei/melrose/ui/cli.repl(0x1400016a2c0, {0x10057dc00, 0x1400015a440})
/Users/mazg/z-music/melrose/ui/cli/app.go:70 +0x2e0
github.com/emicklei/melrose/ui/cli.StartREPL({0x10057dc00, 0x1400015a440})
/Users/mazg/z-music/melrose/ui/cli/app.go:30 +0xc4
main.main()
/Users/mazg/z-music/melrose/cmd/melrose/main.go:20 +0xd8
I have, indeed, no MIDI input sources at the moment.
Ernest Micklei commented
Thank you for reporting this issue. Will work on this
Ernest Micklei commented
I was able to reproduce this by this disabling the IAC Driver in MIDI Studio (simulating no input)
Martin Zacho commented
Haven't tested but I bet it works now:-)