Fix crash on pressing spacebar in the player with no film loaded (#1506).
authorCarl Hetherington <cth@carlh.net>
Mon, 25 Mar 2019 20:51:13 +0000 (20:51 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 25 Mar 2019 20:51:13 +0000 (20:51 +0000)
src/tools/dcpomatic_player.cc

index a1a5a59eb99db36a5190ff83076268692582bd8f..7abc7c9219f0ee470ce739edc02c269030d5085d 100644 (file)
@@ -289,6 +289,9 @@ public:
        void playback_started (DCPTime time)
        {
                /* XXX: this only logs the first piece of content; probably should be each piece? */
+               if (_film->content().empty()) {
+                       return;
+               }
 
                shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent>(_film->content().front());
                if (dcp) {