Don't crash if history items are inaccessible.
[dcpomatic.git] / src / lib / config.cc
index a7a45708193133d5a12bf887eeacdb89f2dcfa2c..1d2ef1e40d25f343c8135cfc88f7eb915f7c9f3e 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 */
                }
        }
 }