Don't crash when trying to create a film in a bad location.
[dcpomatic.git] / src / tools / dcpomatic.cc
index 1e6c49d7bc592f2e9e67533eaf5dd69c92333c7a..2285cccffe8f5b079833eb42f6d00602d9ef2857 100644 (file)
@@ -427,7 +427,11 @@ private:
                int const r = d->ShowModal ();
 
                if (r == wxID_OK && d->check_path() && maybe_save_then_delete_film<FilmChangedClosingDialog>()) {
-                       new_film (d->path(), d->template_name());
+                       try {
+                               new_film (d->path(), d->template_name());
+                       } catch (boost::filesystem::filesystem_error& e) {
+                               error_dialog (this, _("Could not create folder to store film"), std_to_wx(e.what()));
+                       }
                }
 
                d->Destroy ();