From 844fef2e8c295a931c45f5dafa7667fba8715da5 Mon Sep 17 00:00:00 2001 From: eidheim Date: Sun, 3 Apr 2016 08:58:45 +0200 Subject: [PATCH] Fixes #178 --- src/juci.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/juci.cc b/src/juci.cc index f609ce0..1b15e30 100644 --- a/src/juci.cc +++ b/src/juci.cc @@ -52,14 +52,16 @@ void Application::on_activate() { boost::property_tree::ptree pt; boost::property_tree::read_json((Config::get().juci_home_path()/"last_session.json").string(), pt); auto folder=pt.get("folder"); - if(!folder.empty()) + if(!folder.empty() && boost::filesystem::exists(folder)) directories.emplace_back(folder); for(auto &v: pt.get_child("files")) { std::string file=v.second.data(); - if(!file.empty()) + if(!file.empty() && boost::filesystem::exists(file)) files.emplace_back(file); } last_current_file=pt.get("current_file"); + if(!boost::filesystem::exists(last_current_file)) + last_current_file.clear(); } catch(const std::exception &) {} }