diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-12-18 10:45:17 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-12-18 10:45:17 +0000 |
| commit | 03b54137dc7b35594a38f5d2bbe702d3876544f7 (patch) | |
| tree | 7c9c06d7f3f92ab9120091de0372d1c211a4d6f0 /src | |
| parent | 3e5df964ada49e10a880a200c985cc309ccecb64 (diff) | |
Hopefully fix crash on new film in some strange cases.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/config.cc | 8 |
1 files changed, 7 insertions, 1 deletions
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; } |
