X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Foutput%2FCountrySelector.java;h=5bd4b63243641504d0552a4bf8b2b5d1d8615d13;hp=95e373bacf266cafcd2bc0748452de80bd1dcfaf;hb=dea55fb19948e7fa05e4b9369873e96360a5064a;hpb=d3f2bc843552d3011a341555776fc7a77905ab55 diff --git a/src/org/cacert/gigi/output/CountrySelector.java b/src/org/cacert/gigi/output/CountrySelector.java index 95e373ba..5bd4b632 100644 --- a/src/org/cacert/gigi/output/CountrySelector.java +++ b/src/org/cacert/gigi/output/CountrySelector.java @@ -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 {