Don't crash when checking a DCP with no subtitles in some reel.
[dcpomatic.git] / src / lib / dcp_content.cc
index 8d27406fe1cc4917eae28173b6aa79829d28a976..b9b64149f1984832f200806be88c413eaf0fb235 100644 (file)
@@ -747,7 +747,7 @@ DCPContent::can_reference_text (shared_ptr<const Film> film, TextType type, stri
 
         for (auto i: decoder->reels()) {
                 if (type == TextType::OPEN_SUBTITLE) {
-                       if (i->main_subtitle()->entry_point().get_value_or(0) != 0) {
+                       if (i->main_subtitle() && i->main_subtitle()->entry_point().get_value_or(0) != 0) {
                                /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
                                why_not = _("one of its subtitle reels has a non-zero entry point so it must be re-written.");
                                return false;