Fix a bug for jsoncpp1.7 version

This commit is contained in:
an-tao 2018-09-15 19:09:19 +08:00
parent c62f681b2c
commit d20caa2dbb
1 changed files with 3 additions and 3 deletions

View File

@ -85,7 +85,7 @@ static void loadApp(const Json::Value &app)
} }
//file types //file types
auto fileTypes=app["file_types"]; auto fileTypes=app["file_types"];
if(fileTypes&&fileTypes.isArray()&&!fileTypes.empty()) if(fileTypes.isArray()&&!fileTypes.empty())
{ {
std::vector<std::string> types; std::vector<std::string> types;
for(auto fileType:fileTypes) for(auto fileType:fileTypes)
@ -106,7 +106,7 @@ static void loadApp(const Json::Value &app)
if(enableDynamicViews) if(enableDynamicViews)
{ {
auto viewsPaths=app["dynamic_views_path"]; auto viewsPaths=app["dynamic_views_path"];
if(viewsPaths&&viewsPaths.isArray()&&viewsPaths.size()>0) if(viewsPaths.isArray()&&viewsPaths.size()>0)
{ {
std::vector<std::string> paths; std::vector<std::string> paths;
for(auto viewsPath:viewsPaths) for(auto viewsPath:viewsPaths)
@ -161,4 +161,4 @@ void ConfigLoader::load() {
loadApp(_configJsonRoot["app"]); loadApp(_configJsonRoot["app"]);
loadSSL(_configJsonRoot["ssl"]); loadSSL(_configJsonRoot["ssl"]);
loadListeners(_configJsonRoot["listeners"]); loadListeners(_configJsonRoot["listeners"]);
} }