summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-07-02 22:56:56 +0100
committerCarl Hetherington <cth@carlh.net>2019-07-02 23:23:56 +0100
commitd6ac233d9bdba4b42ad84fb7e312aad2a367ea77 (patch)
treebc37aeb3daba7c8bed85b56ede19203065ef6d3b
parentf915e6411ab42a8ea803c7764a6391f6637e69bd (diff)
Don't crash if history items are inaccessible.
Backported from 232ddcc9892a7dfd54efa7533c27c4cfdf71bffd in v2.15.x.
-rw-r--r--src/lib/config.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 4ce4517f8..a4dea7fd1 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -1215,8 +1215,12 @@ Config::clean_history_internal (vector<boost::filesystem::path>& h)
vector<boost::filesystem::path> old = h;
h.clear ();
BOOST_FOREACH (boost::filesystem::path i, old) {
- if (boost::filesystem::is_directory(i)) {
- h.push_back (i);
+ try {
+ if (boost::filesystem::is_directory(i)) {
+ h.push_back (i);
+ }
+ } catch (...) {
+ /* We couldn't find out if it's a directory for some reason; just ignore it */
}
}
}