Merge pull request #7958 from Icinga/bugfix/api-500-404-7956

/v1/actions/*: return 404 if no objects found
This commit is contained in:
Julian Brost 2023-01-24 15:08:17 +01:00 committed by GitHub
commit 5fea15e090
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,6 +62,12 @@ bool ActionsHandler::HandleRequest(
DiagnosticInformation(ex));
return true;
}
if (objs.empty()) {
HttpUtility::SendJsonError(response, params, 404,
"No objects found.");
return true;
}
} else {
FilterUtility::CheckPermission(user, permission);
objs.emplace_back(nullptr);