X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Fpages%2Fwot%2FAssuranceForm.java;h=aca82b917b68fbf6c2433712af1186b930b6ef72;hb=f026ca44afbe85ae41aca180c0771492f0122ad2;hp=9e69bd2f4affed6eb79a427d78e379cee153719c;hpb=adaf867aa0aebdf1278b46eba300acc1a0760a9e;p=gigi.git diff --git a/src/org/cacert/gigi/pages/wot/AssuranceForm.java b/src/org/cacert/gigi/pages/wot/AssuranceForm.java index 9e69bd2f..aca82b91 100644 --- a/src/org/cacert/gigi/pages/wot/AssuranceForm.java +++ b/src/org/cacert/gigi/pages/wot/AssuranceForm.java @@ -167,7 +167,8 @@ public class AssuranceForm extends Form { gae.mergeInto(new GigiApiException("The points entered were not a number.")); } } - HashSet data = new HashSet<>(Arrays.asList(req.getParameterValues("assuredName"))); + String[] parameterValues = req.getParameterValues("assuredName"); + 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())); } @@ -182,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()]));