summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-12-18 10:45:17 +0000
committerCarl Hetherington <cth@carlh.net>2013-12-18 10:45:17 +0000
commit03b54137dc7b35594a38f5d2bbe702d3876544f7 (patch)
tree7c9c06d7f3f92ab9120091de0372d1c211a4d6f0
parent3e5df964ada49e10a880a200c985cc309ccecb64 (diff)
Hopefully fix crash on new film in some strange cases.
-rw-r--r--ChangeLog4
-rw-r--r--src/lib/config.cc8
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3e3f258c8..1f3097c87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-12-18 Carl Hetherington <cth@carlh.net>
+
+ * Hopefully fix exception on new film in some strange cases.
+
2013-12-09 Carl Hetherington <cth@carlh.net>
* Version 1.42 released.
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 54b9168f2..ccbcdf7dd 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -353,7 +353,13 @@ Config::write () const
boost::filesystem::path
Config::default_directory_or (boost::filesystem::path a) const
{
- if (_default_directory.empty() || !boost::filesystem::exists (_default_directory)) {
+ if (_default_directory.empty()) {
+ return a;
+ }
+
+ boost::system::error_code ec;
+ bool const e = boost::filesystem::exists (_default_directory, ec);
+ if (ec || !e) {
return a;
}