Fix crash when loading a non-existant DCP from history in the player.
authorCarl Hetherington <cth@carlh.net>
Tue, 19 Feb 2019 14:06:03 +0000 (14:06 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 19 Feb 2019 14:06:03 +0000 (14:06 +0000)
src/tools/dcpomatic_player.cc

index 6e4f9960c167feb5d71db5ccd258b5d26dce2829..b2f95a20f6f7c01a4052fe830ffe1828358c89df 100644 (file)
@@ -612,7 +612,11 @@ private:
                vector<boost::filesystem::path> history = Config::instance()->player_history ();
                int n = event.GetId() - ID_file_history;
                if (n >= 0 && n < static_cast<int> (history.size ())) {
-                       load_dcp (history[n]);
+                       try {
+                               load_dcp (history[n]);
+                       } catch (exception& e) {
+                               error_dialog (0, std_to_wx(String::compose(wx_to_std(_("Could not load DCP %1.")), history[n])), std_to_wx(e.what()));
+                       }
                }
        }