13
0

Don't assume patch-banks are populated.

This commit is contained in:
Robin Gareus 2016-12-06 22:55:50 +01:00
parent 1ef1734e76
commit 6ce9efb11d
2 changed files with 6 additions and 2 deletions

View File

@ -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();

View File

@ -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;
}