Check on get Mandatory

This commit is contained in:
Fabio Sinibaldi 2022-05-31 15:14:23 +02:00
parent c489f267e6
commit a0ffa08813
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}