Skip to content

Commit

Permalink
Make JsonParser fail on empty (maybe filtered invalid) domains array …
Browse files Browse the repository at this point in the history
…of MailDomainGroup. IQSS#6936
  • Loading branch information
poikilotherm committed Jun 10, 2020
1 parent 389324b commit 09c7f64
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ public MailDomainGroup parseMailDomainGroup(JsonObject obj) throws JsonParseExce
.map(JsonString::getString)
.filter(d -> DomainValidator.getInstance().isValid(d))
.collect(Collectors.toList());
if (domains.isEmpty())
throw new JsonParseException("Field domains may not be an empty array or contain invalid domains.");
grp.setEmailDomains(domains);
} else {
throw new JsonParseException("Field domains is mandatory.");
Expand Down

0 comments on commit 09c7f64

Please sign in to comment.