diff options
-rw-r--r-- | gtk2_ardour/sfdb_ui.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index 9ef39d0aaa..8e89ccf4b3 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -283,10 +283,15 @@ SoundFileBox::setup_labels (const string& filename) if (SMFSource::valid_midi_file (path)) { - boost::shared_ptr<SMFSource> ms = - boost::dynamic_pointer_cast<SMFSource> ( - SourceFactory::createExternal (DataType::MIDI, *_session, - path, 0, Source::Flag (0), false)); + boost::shared_ptr<SMFSource> ms; + try { + ms = boost::dynamic_pointer_cast<SMFSource> ( + SourceFactory::createExternal (DataType::MIDI, *_session, + path, 0, Source::Flag (0), false)); + } catch (const std::exception& e) { + error << string_compose(_("Could not read file: %1 (%2)."), + path, e.what()) << endmsg; + } preview_label.set_markup (_("<b>Midi File Information</b>")); |