From 38c2bdc856ce9c57264b063ee943887bc4725ba6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 10 Jan 2015 19:31:50 +0100 Subject: gracefully handle missing .midnam Fixes bug: Add a .midnam to local preferences. use it in a session. delete the .midnam, reload session -> crash --- gtk2_ardour/midi_time_axis.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gtk2_ardour/midi_time_axis.cc') diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 33d192aa1c..6987680f26 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -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 (); -- cgit v1.2.3