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

View File

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