Don't try to send KDM email unless we have a from address.
[dcpomatic.git] / src / lib / string_text_file_content.cc
index 7ee870e1815be9c09d6430ae7427bdcd4f9f509f..d8c195be77af1fe53ada9e66830d776ad4810826 100644 (file)
@@ -89,9 +89,7 @@ StringTextFileContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job
        /* Default to turning these subtitles on */
        only_text()->set_use (true);
 
-       std::set<string> names = font_names(file);
-
-       for (auto name: names) {
+       for (auto name: font_names(file)) {
                optional<boost::filesystem::path> path;
                if (!name.empty()) {
                        path = FontConfig::instance()->system_font_with_name(name);
@@ -191,7 +189,10 @@ StringTextFileContent::check_font_ids()
        auto names = font_names(file);
 
        auto content = only_text();
-       auto legacy_font_file = content->get_font("font")->file();
+       optional<boost::filesystem::path> legacy_font_file;
+       if (auto legacy_font = content->get_font("font")) {
+               legacy_font_file = legacy_font->file();
+       }
 
        for (auto name: names) {
                if (!content->get_font(name)) {