Be a bit more careful with content_factory().
authorCarl Hetherington <cth@carlh.net>
Sat, 9 Jul 2022 18:39:10 +0000 (20:39 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 11 Jul 2022 10:22:11 +0000 (12:22 +0200)
src/wx/content_view.cc

index c26186c552f550deda76858f47b92de262fb329e..57a5535c9bd8eb1b3d3208d77fb66ec4b19204f7 100644 (file)
@@ -97,7 +97,10 @@ ContentView::update ()
                        if (is_directory(i) && (is_regular_file(i / "ASSETMAP") || is_regular_file(i / "ASSETMAP.xml"))) {
                                content.reset (new DCPContent(i));
                        } else if (i.path().extension() == ".mp4") {
-                               content = content_factory(i).front();
+                               auto all_content = content_factory(i);
+                               if (!all_content.empty()) {
+                                       content = all_content.front();
+                               }
                        }
 
                        if (content) {