From bce51c1af5d09fc5760dc7d915e9b438d648ae03 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Thu, 2 Apr 2020 11:50:07 +0200 Subject: [PATCH] /v1/actions/*: return 404 if no objects found refs #7956 --- lib/remote/actionshandler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/remote/actionshandler.cpp b/lib/remote/actionshandler.cpp index 7b61cd5b9..95dbefe3b 100644 --- a/lib/remote/actionshandler.cpp +++ b/lib/remote/actionshandler.cpp @@ -59,6 +59,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);