diff --git a/libprocessgroup/task_profiles.cpp b/libprocessgroup/task_profiles.cpp index f13a6815c..db00a4981 100644 --- a/libprocessgroup/task_profiles.cpp +++ b/libprocessgroup/task_profiles.cpp @@ -518,10 +518,10 @@ bool TaskProfiles::Load(const CgroupMap& cg_map, const std::string& file_name) { std::string attr_filepath = params_val["FilePath"].asString(); std::string attr_value = params_val["Value"].asString(); if (!attr_filepath.empty() && !attr_value.empty()) { - const Json::Value& logfailures = params_val["LogFailures"]; - bool attr_logfailures = logfailures.isNull() || logfailures.asBool(); + std::string attr_logfailures = params_val["LogFailures"].asString(); + bool logfailures = attr_logfailures.empty() || attr_logfailures == "true"; profile->Add(std::make_unique(attr_filepath, attr_value, - attr_logfailures)); + logfailures)); } else if (attr_filepath.empty()) { LOG(WARNING) << "WriteFile: invalid parameter: " << "empty filepath";