Merge master.
[dcpomatic.git] / src / wx / film_editor.cc
index 7fa34c516c60875e0208b0f907adf6d332078b94..2cf6a0b6ccc6847a627bfeb63a848a8e407d6ab8 100644 (file)
@@ -803,11 +803,16 @@ FilmEditor::content_add_folder_clicked ()
                return;
        }
 
-       _film->examine_and_add_content (
-               shared_ptr<ImageContent> (
-                       new ImageContent (_film, boost::filesystem::path (wx_to_std (d->GetPath ())))
-                       )
-               );
+       shared_ptr<ImageContent> ic;
+       
+       try {
+               ic.reset (new ImageContent (_film, boost::filesystem::path (wx_to_std (d->GetPath ()))));
+       } catch (FileError& e) {
+               error_dialog (this, std_to_wx (e.what ()));
+               return;
+       }
+
+       _film->examine_and_add_content (ic);
 }
 
 void