Don't crash if history items are inaccessible.
authorCarl Hetherington <cth@carlh.net>
Tue, 2 Jul 2019 21:56:56 +0000 (22:56 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 2 Jul 2019 21:56:56 +0000 (22:56 +0100)
src/lib/config.cc

index a7a4570..1d2ef1e 100644 (file)
@@ -1230,8 +1230,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 */
                }
        }
 }