Skip to content

Commit 22754f3

Browse files
committed
fix: add result to inserted check
1 parent fbf8a06 commit 22754f3

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/modules/sca/src/sca_policy_loader.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,22 @@ void SCAPolicyLoader::SyncPoliciesAndReportDelta(const nlohmann::json& data, con
121121

122122
for (auto& check : modifiedChecksMap)
123123
{
124-
if (check.second["result"] == MODIFIED)
124+
try
125125
{
126-
try
126+
if (check.second["result"] == INSERTED)
127127
{
128-
check.second["data"]["new"]["result"] = "Not run";
129-
UpdateCheckResult(check.second["data"]["new"]);
128+
check.second["data"]["result"] = "Not run";
130129
}
131-
catch (const std::exception& e)
130+
else if (check.second["result"] == MODIFIED)
132131
{
133-
LogError("Failed to update check result: {}", e.what());
132+
check.second["data"]["new"]["result"] = "Not run";
133+
UpdateCheckResult(check.second["data"]["new"]);
134134
}
135135
}
136+
catch (const std::exception& e)
137+
{
138+
LogError("Failed to update check result: {}", e.what());
139+
}
136140
}
137141
}
138142
else

0 commit comments

Comments
 (0)