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
This commit is contained in:
Carl Hetherington 2012-02-26 20:48:51 +00:00
parent fdca23a791
commit bd2e28aaac
2 changed files with 9 additions and 2 deletions

View File

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

View File

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