Fix crash on loading non-existant DCP from recent menu.
authorCarl Hetherington <cth@carlh.net>
Wed, 17 Jan 2018 00:07:26 +0000 (00:07 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 17 Jan 2018 00:07:26 +0000 (00:07 +0000)
src/tools/dcpomatic_player.cc

index 4388ebbc3cce90949e1bba7a3fa88672181b7b61..4425f34d1e6d9cc72085676f6169a318ce73e5f5 100644 (file)
@@ -145,7 +145,14 @@ public:
        void load_dcp (boost::filesystem::path dir)
        {
                _film.reset (new Film (optional<boost::filesystem::path>()));
-               shared_ptr<DCPContent> dcp (new DCPContent (_film, dir));
+               shared_ptr<DCPContent> dcp;
+               try {
+                       dcp.reset (new DCPContent (_film, dir));
+               } catch (boost::filesystem::filesystem_error& e) {
+                       error_dialog (this, _("Could not load DCP"), std_to_wx (e.what()));
+                       return;
+               }
+
                _film->examine_and_add_content (dcp, true);
 
                JobManager* jm = JobManager::instance ();