From: Carl Hetherington Date: Wed, 22 Aug 2018 13:33:32 +0000 (+0100) Subject: Fix crash when trying to make a KDM on an unencrypted project. X-Git-Tag: v2.13.45~24 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=f870c4052c8e508b5e85693e380a2a3c29873356;p=dcpomatic.git Fix crash when trying to make a KDM on an unencrypted project. --- 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 film = _film.lock (); DCPOMATIC_ASSERT (film); - list 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() : 0 - ); + list 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() : 0 + ); + + } catch (runtime_error& e) { + error_dialog (this, std_to_wx(e.what())); + return; + } pair, int> result = _output->make (screen_kdms, film->name(), _timing, bind (&KDMDialog::confirm_overwrite, this, _1), film->log()); if (result.first) {