diff options
author | Robin Gareus <robin@gareus.org> | 2016-12-06 22:55:50 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-12-06 22:56:04 +0100 |
commit | 6ce9efb11d01042c72044db98c6839db78bb4694 (patch) | |
tree | 166734dd690b443868107d64220aa4c7c266f546 /gtk2_ardour | |
parent | 1ef1734e7625afe9771049c9c5fe4047ec229c5d (diff) |
Don't assume patch-banks are populated.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/midi_time_axis.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/patch_change.cc | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 97d7ae1727..84d88c8f9e 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -1133,9 +1133,13 @@ MidiTimeAxisView::build_patch_menu() if (!channel_name_set) { continue; } + const ChannelNameSet::PatchBanks& patch_banks = channel_name_set->patch_banks(); + if (patch_banks.size () == 0) { + continue; + } + Gtk::Menu& chan_menu = *manage(new Gtk::Menu()); - const ChannelNameSet::PatchBanks& patch_banks = channel_name_set->patch_banks(); if (patch_banks.size() > 1) { for (ChannelNameSet::PatchBanks::const_iterator bank = patch_banks.begin(); diff --git a/gtk2_ardour/patch_change.cc b/gtk2_ardour/patch_change.cc index 4006cbdf46..ee4165df4a 100644 --- a/gtk2_ardour/patch_change.cc +++ b/gtk2_ardour/patch_change.cc @@ -82,7 +82,7 @@ PatchChange::initialize_popup_menus() boost::shared_ptr<ChannelNameSet> channel_name_set = _info.get_patches (_patch->channel()); - if (!channel_name_set) { + if (!channel_name_set || channel_name_set->patch_banks().size () == 0) { return; } |