diff options
author | Carl Hetherington <carl@carlh.net> | 2011-08-09 13:04:28 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-08-09 13:04:28 +0000 |
commit | e76840c089e6e8a1c826349fc20830b8443f5406 (patch) | |
tree | 7ef9c4c960245e5b90e1b1b5cef7120874b0c777 /libs | |
parent | 7aac277ce1843676084c07365104ee5ac9210695 (diff) |
Prevent crash on de-selecting all tracks from a stem export
(#4167).
git-svn-id: svn://localhost/ardour2/branches/3.0@9967 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/export_profile_manager.cc | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/libs/ardour/export_profile_manager.cc b/libs/ardour/export_profile_manager.cc index 766067ece2..7eaa7c0632 100644 --- a/libs/ardour/export_profile_manager.cc +++ b/libs/ardour/export_profile_manager.cc @@ -738,15 +738,21 @@ ExportProfileManager::get_warnings () { boost::shared_ptr<Warnings> warnings (new Warnings ()); - assert (!channel_configs.empty ()); - - ChannelConfigStatePtr channel_config_state = channel_configs.front(); + ChannelConfigStatePtr channel_config_state; + if (!channel_configs.empty ()) { + channel_config_state = channel_configs.front(); + } + TimespanStatePtr timespan_state = timespans.front(); /*** Check "global" config ***/ TimespanListPtr timespans = timespan_state->timespans; - ExportChannelConfigPtr channel_config = channel_config_state->config; + + ExportChannelConfigPtr channel_config; + if (channel_config_state) { + channel_config = channel_config_state->config; + } /* Check Timespans are not empty */ @@ -754,22 +760,27 @@ ExportProfileManager::get_warnings () warnings->errors.push_back (_("No timespan has been selected!")); } - /* Check channel config ports */ - - if (!channel_config->all_channels_have_ports ()) { - warnings->warnings.push_back (_("Some channels are empty")); + if (channel_config_state == 0) { + warnings->errors.push_back (_("No channels have been selected!")); + } else { + /* Check channel config ports */ + if (!channel_config->all_channels_have_ports ()) { + warnings->warnings.push_back (_("Some channels are empty")); + } } /*** Check files ***/ - FormatStateList::const_iterator format_it; - FilenameStateList::const_iterator filename_it; - for (format_it = formats.begin(), filename_it = filenames.begin(); - format_it != formats.end() && filename_it != filenames.end(); - ++format_it, ++filename_it) { + if (channel_config_state) { + FormatStateList::const_iterator format_it; + FilenameStateList::const_iterator filename_it; + for (format_it = formats.begin(), filename_it = filenames.begin(); + format_it != formats.end() && filename_it != filenames.end(); + ++format_it, ++filename_it) { check_config (warnings, timespan_state, channel_config_state, *format_it, *filename_it); + } } - + return warnings; } |