diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2016-08-03 18:54:55 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2016-08-03 18:54:55 +0300 |
commit | 6e1ffb99805ea6a19f357cb74f63fe57aaf6236d (patch) | |
tree | 0d2103b707ba3cb0f74d78ab7eca2675fe9f18e5 /server/modules/metadata/flat_files/main.cpp | |
parent | 3bae8115dda2ee5a8e055b4f1aea45fa43088eab (diff) |
server:
all projects: corected cflafs/cxxflags
modules:
metadata_flat:
fixed crash on non-existing setting check
client:
enable ui only after events subscription to avid hypotetically not handled events
Diffstat (limited to 'server/modules/metadata/flat_files/main.cpp')
-rw-r--r-- | server/modules/metadata/flat_files/main.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/server/modules/metadata/flat_files/main.cpp b/server/modules/metadata/flat_files/main.cpp index f58f782..ec9d5a2 100644 --- a/server/modules/metadata/flat_files/main.cpp +++ b/server/modules/metadata/flat_files/main.cpp @@ -118,7 +118,7 @@ bool storage_impl::set(const std::string &module_name, const std::string &settin } else if(!boost::filesystem::is_directory(out_file_path)) { - //error + //TODO: handle error return false; } out_file_path += "/"; @@ -169,9 +169,12 @@ std::list<std::string> storage_impl::setting_list(const std::string &module_name std::string settings_dir = parsed_data_path; settings_dir += "/"; settings_dir += module_name; - for(auto i = boost::filesystem::directory_iterator(settings_dir), end = boost::filesystem::directory_iterator(); i != end; ++i) + if(boost::filesystem::exists(settings_dir) && boost::filesystem::is_directory(settings_dir)) { - l.push_back(i->path().string().substr(settings_dir.length() + 1)); + for(auto i = boost::filesystem::directory_iterator(settings_dir), end = boost::filesystem::directory_iterator(); i != end; ++i) + { + l.push_back(i->path().string().substr(settings_dir.length() + 1)); + } } return l; } |