X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Fwot%2FAssuranceForm.java;h=aca82b917b68fbf6c2433712af1186b930b6ef72;hp=6084c321f694dafa7c814fabf040dacc97713914;hb=0dfe195d39328924a19f9301278eaba97f57c1b8;hpb=304c4527b30ac4f89a697787b96851d2f8e2f821 diff --git a/src/org/cacert/gigi/pages/wot/AssuranceForm.java b/src/org/cacert/gigi/pages/wot/AssuranceForm.java index 6084c321..aca82b91 100644 --- a/src/org/cacert/gigi/pages/wot/AssuranceForm.java +++ b/src/org/cacert/gigi/pages/wot/AssuranceForm.java @@ -168,7 +168,7 @@ public class AssuranceForm extends Form { } } String[] parameterValues = req.getParameterValues("assuredName"); - HashSet data = new HashSet<>(Arrays.asList(parameterValues==null?new String[0]:parameterValues)); + HashSet data = new HashSet<>(Arrays.asList(parameterValues == null ? new String[0] : parameterValues)); for (int i = 0; i < assureeNames.length; i++) { selected[i] = data.contains(Integer.toString(assureeNames[i].getId())); } @@ -183,6 +183,9 @@ public class AssuranceForm extends Form { toAssure.add(assureeNames[i]); } } + if (toAssure.size() == 0) { + throw new GigiApiException("You must confirm at least one name to verify an account."); + } Notary.assureAll(assurer, assuree, dob, pointsI, location, req.getParameter("date"), type, toAssure.toArray(new Name[toAssure.size()]));