From a0ffa088131bf166f6c521f42509d965bbb98e06 Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Tue, 31 May 2022 15:14:23 +0200 Subject: [PATCH] Check on get Mandatory --- .../org/gcube/application/cms/plugins/requests/BaseRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cms-plugin-framework/src/main/java/org/gcube/application/cms/plugins/requests/BaseRequest.java b/cms-plugin-framework/src/main/java/org/gcube/application/cms/plugins/requests/BaseRequest.java index 587d349..91c0b0c 100644 --- a/cms-plugin-framework/src/main/java/org/gcube/application/cms/plugins/requests/BaseRequest.java +++ b/cms-plugin-framework/src/main/java/org/gcube/application/cms/plugins/requests/BaseRequest.java @@ -38,7 +38,7 @@ public class BaseRequest { } public static final String getMandatory(String param,Document params) throws InvalidPluginRequestException { - if(!params.containsKey(param)) throw new InvalidPluginRequestException("Missing mandatory parameter "+param); + if(params==null || params.isEmpty()|| !params.containsKey(param)) throw new InvalidPluginRequestException("Missing mandatory parameter "+param); return params.getString(param); }