This is an automated email from the git hooks/post-receive script. New commit to branch feature/bug-on-save in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 247025bda9d5609f6811e72662065eacdf97f9d7 Author: dcosse <cosse@codelutin.com> Date: Wed Oct 9 17:44:18 2019 +0200 refs #249 fix issue on empty list check --- .../java/org/chorem/pollen/services/service/VoterListService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/VoterListService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/VoterListService.java index f4c00112..49cbe5bd 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/VoterListService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/VoterListService.java @@ -542,7 +542,13 @@ public class VoterListService extends PollenServiceSupport { checkNotBlank(errors, VoterList.PROPERTY_NAME, voterList.getName(), l(getLocale(), "pollen.error.voterList.name.mandatory")); check(errors, VoterList.PROPERTY_WEIGHT, voterList.getWeight() > 0, l(getLocale(), "pollen.error.voterList.weight.greaterThan0")); - final boolean condition = subLists.stream().noneMatch(voterListBean -> voterListBean.getCountMembers() == 0); + boolean condition; + if (subLists.size() == 0 && voterList.getCountMembers() == 0) { + condition = false; + } else { + condition = subLists.stream().noneMatch(voterListBean -> voterListBean.getCountMembers() == 0); + } + check(errors, "member", condition, l(getLocale(), "pollen.error.voterList.member.mandatory")); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.