mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
gracefully handle missing .midnam
Fixes bug: Add a .midnam to local preferences. use it in a session. delete the .midnam, reload session -> crash
This commit is contained in:
parent
44203ce955
commit
38c2bdc856
2 changed files with 9 additions and 4 deletions
|
|
@ -440,7 +440,11 @@ MidiTimeAxisView::model_changed(const std::string& model)
|
|||
_midnam_custom_device_mode_selector.hide();
|
||||
}
|
||||
|
||||
_route->instrument_info().set_external_instrument (model, device_modes.front());
|
||||
if (device_modes.size() > 0) {
|
||||
_route->instrument_info().set_external_instrument (model, device_modes.front());
|
||||
} else {
|
||||
_route->instrument_info().set_external_instrument (model, "");
|
||||
}
|
||||
|
||||
// Rebuild controller menu
|
||||
_controller_menu_map.clear ();
|
||||
|
|
|
|||
|
|
@ -126,10 +126,11 @@ public:
|
|||
|
||||
std::list<std::string> custom_device_mode_names_by_model(std::string model_name) {
|
||||
if (model_name != "") {
|
||||
return master_device_by_model(model_name)->custom_device_mode_names();
|
||||
} else {
|
||||
return std::list<std::string>();
|
||||
if (master_device_by_model(model_name)) {
|
||||
return master_device_by_model(model_name)->custom_device_mode_names();
|
||||
}
|
||||
}
|
||||
return std::list<std::string>();
|
||||
}
|
||||
|
||||
const MasterDeviceNames::Models& all_models() const { return _all_models; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue