From e36a053b84a6f1fe3b4a6bc2f2da63f655b3a799 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 27 Sep 2020 23:13:24 -0700 Subject: [PATCH] Sequencer: Don't crash when user picks the branch instead of the leaf in scale chooser. --- sequencer/src/gui/ui.fl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sequencer/src/gui/ui.fl b/sequencer/src/gui/ui.fl index b46abc9..f34944f 100644 --- a/sequencer/src/gui/ui.fl +++ b/sequencer/src/gui/ui.fl @@ -847,6 +847,12 @@ o->maximum( pattern::patterns() );} char picked[80]; mapping_menu->item_pathname(picked, sizeof(picked)-1 ); +const char *text = o->text(); + +if ( ! strcmp( text, picked ) ) + // nothing picked... + return; + if ( 0 == strncmp( picked, "Instrument", strlen( "Instrument" ) ) ) { ((pattern*)pattern_canvas_widget->grid())->mapping.open( Mapping::INSTRUMENT, o->text() );