diff --git a/Service/src/main/java/org/gusdb/wdk/service/service/AnswerService.java b/Service/src/main/java/org/gusdb/wdk/service/service/AnswerService.java index 74497498b..d284af881 100644 --- a/Service/src/main/java/org/gusdb/wdk/service/service/AnswerService.java +++ b/Service/src/main/java/org/gusdb/wdk/service/service/AnswerService.java @@ -277,6 +277,11 @@ static AnswerRequest parseAnswerRequest(Question question, String reporterName, JSONObject requestBody, WdkModel wdkModel, User sessionUser, boolean avoidCacheHit) throws RequestMisformatException, DataValidationException, WdkModelException { + if (requestBody == null || !requestBody.has(JsonKeys.SEARCH_CONFIG) || !requestBody.has(JsonKeys.REPORT_CONFIG)) { + throw new RequestMisformatException("Request body must not be null and must contain '" + + JsonKeys.SEARCH_CONFIG + "' and '" + JsonKeys.REPORT_CONFIG + "' properties."); + } + // parse view filters FilterOptionListBuilder viewFilters = AnswerSpecServiceFormat.parseViewFilters(requestBody);