Fix crash on opening the export dialogue when there are no
authorCarl Hetherington <carl@carlh.net>
Sun, 26 Feb 2012 20:48:51 +0000 (20:48 +0000)
committerCarl Hetherington <carl@carlh.net>
Sun, 26 Feb 2012 20:48:51 +0000 (20:48 +0000)
formats (#4742).

git-svn-id: svn://localhost/ardour2/branches/3.0@11524 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/export_file_notebook.cc
libs/ardour/export_profile_manager.cc

index 959bc42a2f22827260541107d4bf04eb3977eb3a..c9cd747d75ccc5b5ed2b796d27553c9f7c0b27a7 100644 (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());
index c644687f59beeb3110768f61b3a0ec2cba5659af..54779cfa326817e2558dada332bf59fb8a1374a1 100644 (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;