]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/pages/account/domain/PingConfigForm.java
fix: error in domain Pingconfig + default first column size
[gigi.git] / src / org / cacert / gigi / pages / account / domain / PingConfigForm.java
index e18b7fb97c929cce0155f387bd27b4d5c415301b..9e8c0b027957bf8269c8c321295f5ddcff5cc2fe 100644 (file)
@@ -106,9 +106,13 @@ public class PingConfigForm extends Form {
 
     @Override
     public boolean submit(PrintWriter out, HttpServletRequest req) throws GigiApiException {
-        if (req.getParameter("emailType") != null) {
-            String mail = AUTHORATIVE_EMAILS[Integer.parseInt(req.getParameter("email"))];
-            target.addPing(DomainPingType.EMAIL, mail);
+        if (req.getParameter("emailType") != null && req.getParameter("email") != null) {
+            try {
+                String mail = AUTHORATIVE_EMAILS[Integer.parseInt(req.getParameter("email"))];
+                target.addPing(DomainPingType.EMAIL, mail);
+            } catch (NumberFormatException e) {
+                throw new GigiApiException("A email address is required");
+            }
         }
         if (req.getParameter("DNSType") != null) {
             target.addPing(DomainPingType.DNS, tokenName + ":" + tokenValue);