fix: NPE with missing parameter for verification
authorFelix Dörre <felix@dogcraft.de>
Thu, 28 Jul 2016 21:05:27 +0000 (23:05 +0200)
committerFelix Dörre <felix@dogcraft.de>
Fri, 29 Jul 2016 14:36:27 +0000 (16:36 +0200)
Change-Id: I598a3c2d41edd32ffa40bb35a0c4155c07c960dd

src/org/cacert/gigi/pages/wot/AssuranceForm.java

index 9e69bd2..6084c32 100644 (file)
@@ -167,7 +167,8 @@ public class AssuranceForm extends Form {
                 gae.mergeInto(new GigiApiException("The points entered were not a number."));
             }
         }
-        HashSet<String> data = new HashSet<>(Arrays.asList(req.getParameterValues("assuredName")));
+        String[] parameterValues = req.getParameterValues("assuredName");
+        HashSet<String> 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()));
         }