From: Carl Hetherington Date: Fri, 26 Aug 2016 08:21:21 +0000 (+0100) Subject: Fix exception on new file with no templates. X-Git-Tag: v2.9.17~3 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=de8325fedcbfbd516d91a89be9270299dec49332;hp=e02d76fcb78542f487038982bfcc9bb5a935b94e;p=dcpomatic.git Fix exception on new file with no templates. --- diff --git a/src/lib/config.cc b/src/lib/config.cc index 1d9cce64e..872900a73 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -599,6 +599,10 @@ Config::save_template (shared_ptr film, string name) const list Config::templates () const { + if (!boost::filesystem::exists (path ("templates"))) { + return list (); + } + list n; for (boost::filesystem::directory_iterator i (path("templates")); i != boost::filesystem::directory_iterator(); ++i) { n.push_back (i->path().filename().string());