projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e02d76f
)
Fix exception on new file with no templates.
author
Carl Hetherington
<cth@carlh.net>
Fri, 26 Aug 2016 08:21:21 +0000
(09:21 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Fri, 26 Aug 2016 08:21:21 +0000
(09:21 +0100)
src/lib/config.cc
patch
|
blob
|
history
diff --git
a/src/lib/config.cc
b/src/lib/config.cc
index 1d9cce64e9fb81516081423b7d8a740492f8c306..872900a73ec6d3b5730b73b9b9d58d2f28ff4b2e 100644
(file)
--- a/
src/lib/config.cc
+++ b/
src/lib/config.cc
@@
-599,6
+599,10
@@
Config::save_template (shared_ptr<const Film> film, string name) const
list<string>
Config::templates () const
{
list<string>
Config::templates () const
{
+ if (!boost::filesystem::exists (path ("templates"))) {
+ return list<string> ();
+ }
+
list<string> n;
for (boost::filesystem::directory_iterator i (path("templates")); i != boost::filesystem::directory_iterator(); ++i) {
n.push_back (i->path().filename().string());
list<string> n;
for (boost::filesystem::directory_iterator i (path("templates")); i != boost::filesystem::directory_iterator(); ++i) {
n.push_back (i->path().filename().string());