From 415aab6bb6ee5ee372f6100dcbcce35509531d07 Mon Sep 17 00:00:00 2001 From: Benoit DUMONT Date: Mon, 2 Dec 2024 21:54:30 +0100 Subject: [PATCH] Secure that service cannot be update to empty value. #2554 --- .../servlet/crud/countryenvironment/UpdateAppService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/src/main/java/org/cerberus/core/servlet/crud/countryenvironment/UpdateAppService.java b/source/src/main/java/org/cerberus/core/servlet/crud/countryenvironment/UpdateAppService.java index 0935a7dce..4efb41b44 100644 --- a/source/src/main/java/org/cerberus/core/servlet/crud/countryenvironment/UpdateAppService.java +++ b/source/src/main/java/org/cerberus/core/servlet/crud/countryenvironment/UpdateAppService.java @@ -172,6 +172,12 @@ final void processRequest(final HttpServletRequest request, final HttpServletRes * Checking all constrains before calling the services. */ if (StringUtil.isEmptyOrNull(originalService)) { + msg = new MessageEvent(MessageEventEnum.DATA_OPERATION_ERROR_EXPECTED); + msg.setDescription(msg.getDescription().replace("%ITEM%", "AppService") + .replace("%OPERATION%", "Update") + .replace("%REASON%", "AppService ID (originalService) is missing.")); + finalAnswer.setResultMessage(msg); + } else if (StringUtil.isEmptyOrNull(service)) { msg = new MessageEvent(MessageEventEnum.DATA_OPERATION_ERROR_EXPECTED); msg.setDescription(msg.getDescription().replace("%ITEM%", "AppService") .replace("%OPERATION%", "Update")