summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--src/lib/content_factory.cc5
-rw-r--r--src/wx/content_panel.cc4
3 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 7fa5553f3..ef152fe25 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2015-09-16 Carl Hetherington <cth@carlh.net>
+ * Fix exception on adding an empty folder
+ as content (#691).
+
* Add config option for default standard
(SMPTE / Interop).
diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc
index c61889363..5b6d71641 100644
--- a/src/lib/content_factory.cc
+++ b/src/lib/content_factory.cc
@@ -77,6 +77,11 @@ content_factory (shared_ptr<const Film> film, boost::filesystem::path path)
shared_ptr<Content> content;
if (boost::filesystem::is_directory (path)) {
+
+ if (boost::filesystem::is_empty (path)) {
+ return shared_ptr<Content> ();
+ }
+
/* Guess if this is a DCP or a set of images: read the first ten filenames and if they
are all valid image files we assume it is a set of images.
*/
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index 2552f5098..8ca0d5b29 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -277,6 +277,10 @@ ContentPanel::add_folder_clicked ()
}
shared_ptr<Content> content = content_factory (_film, path);
+ if (!content) {
+ error_dialog (_parent, _("No content found in this folder."));
+ return;
+ }
shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (content);
if (ic) {