]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/output/CountrySelector.java
upd: narrowing type-safety around Organisation
[gigi.git] / src / org / cacert / gigi / output / CountrySelector.java
index 95e373bacf266cafcd2bc0748452de80bd1dcfaf..5bd4b63243641504d0552a4bf8b2b5d1d8615d13 100644 (file)
@@ -32,6 +32,10 @@ public class CountrySelector implements Outputable {
     public CountrySelector(String name, boolean optional, CountryCode state) {
         this(name, optional);
         selected = state == null ? null : state.convertToCountryCodeType(CountryCodeType.CODE_2_CHARS);
+        if (state.getCountryCodeType() != CountryCodeType.CODE_2_CHARS) {
+            throw new IllegalArgumentException("Got country code of illegal type.");
+        }
+        selected = state;
     }
 
     public void update(HttpServletRequest r) throws GigiApiException {