diff options
author | Carl Hetherington <carl@carlh.net> | 2012-02-26 20:48:51 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-02-26 20:48:51 +0000 |
commit | bd2e28aaacaf75448324cdd139d2062ce595d2c1 (patch) | |
tree | 55a5adf47057a5871a62a17ed04dc40f5bedab51 | |
parent | fdca23a79169be8f12655ed6dea3e37948321e9c (diff) |
Fix crash on opening the export dialogue when there are no
formats (#4742).
git-svn-id: svn://localhost/ardour2/branches/3.0@11524 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/export_file_notebook.cc | 9 | ||||
-rw-r--r-- | libs/ardour/export_profile_manager.cc | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gtk2_ardour/export_file_notebook.cc b/gtk2_ardour/export_file_notebook.cc index 959bc42a2f..c9cd747d75 100644 --- a/gtk2_ardour/export_file_notebook.cc +++ b/gtk2_ardour/export_file_notebook.cc @@ -273,8 +273,13 @@ void ExportFileNotebook::FilePage::update_example_filename() { if (profile_manager) { - std::string example = profile_manager->get_sample_filename_for_format ( - filename_state->filename, format_state->format); + + std::string example; + if (format_state->format) { + example = profile_manager->get_sample_filename_for_format ( + filename_state->filename, format_state->format); + } + if (example != "") { sys::path path(example); filename_selector.set_example_filename(path.leaf()); diff --git a/libs/ardour/export_profile_manager.cc b/libs/ardour/export_profile_manager.cc index c644687f59..54779cfa32 100644 --- a/libs/ardour/export_profile_manager.cc +++ b/libs/ardour/export_profile_manager.cc @@ -714,6 +714,8 @@ ExportProfileManager::remove_filename_state (FilenameStatePtr state) std::string ExportProfileManager::get_sample_filename_for_format (ExportFilenamePtr filename, ExportFormatSpecPtr format) { + assert (format); + if (channel_configs.empty()) { return ""; } std::list<string> filenames; |