summaryrefslogtreecommitdiff
path: root/src/wx/kdm_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-08-22 14:33:32 +0100
committerCarl Hetherington <cth@carlh.net>2018-08-22 14:33:32 +0100
commitf870c4052c8e508b5e85693e380a2a3c29873356 (patch)
tree6de9d50a493a6a77e8caf60031062ee11177c8cb /src/wx/kdm_dialog.cc
parent927d4d2f5bd1d77024369fc1f7de32ca085a3ee4 (diff)
Fix crash when trying to make a KDM on an unencrypted project.
Diffstat (limited to 'src/wx/kdm_dialog.cc')
-rw-r--r--src/wx/kdm_dialog.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc
index be7e25065..45dc2b477 100644
--- a/src/wx/kdm_dialog.cc
+++ b/src/wx/kdm_dialog.cc
@@ -47,6 +47,7 @@ using std::pair;
using std::cout;
using std::vector;
using std::make_pair;
+using std::runtime_error;
using boost::shared_ptr;
using boost::bind;
@@ -139,10 +140,18 @@ KDMDialog::make_clicked ()
shared_ptr<const Film> film = _film.lock ();
DCPOMATIC_ASSERT (film);
- list<ScreenKDM> screen_kdms = film->make_kdms (
- _screens->screens(), _cpl->cpl(), _timing->from(), _timing->until(), _output->formulation(),
- !_output->forensic_mark_video(), _output->forensic_mark_audio() ? boost::optional<int>() : 0
- );
+ list<ScreenKDM> screen_kdms;
+ try {
+
+ screen_kdms = film->make_kdms (
+ _screens->screens(), _cpl->cpl(), _timing->from(), _timing->until(), _output->formulation(),
+ !_output->forensic_mark_video(), _output->forensic_mark_audio() ? boost::optional<int>() : 0
+ );
+
+ } catch (runtime_error& e) {
+ error_dialog (this, std_to_wx(e.what()));
+ return;
+ }
pair<shared_ptr<Job>, int> result = _output->make (screen_kdms, film->name(), _timing, bind (&KDMDialog::confirm_overwrite, this, _1), film->log());
if (result.first) {