It's possible for StandardAddressVerifier.verifyFields() to crash with:
Fatal Exception: java.lang.NullPointerException: Cannot use null as key
at com.google.i18n.addressinput.common.Util.checkNotNull(Util.java:123)
at com.google.i18n.addressinput.common.FieldVerifier.isCountryKey(FieldVerifier.java:439)
at com.google.i18n.addressinput.common.FieldVerifier.populate(FieldVerifier.java:171)
at com.google.i18n.addressinput.common.FieldVerifier.<init>(FieldVerifier.java:105)
at com.google.i18n.addressinput.common.FieldVerifier.refineVerifier(FieldVerifier.java:283)
at com.google.i18n.addressinput.common.StandardAddressVerifier$Verifier.run(StandardAddressVerifier.java:132)
at com.google.i18n.addressinput.common.StandardAddressVerifier.verifyFields(StandardAddressVerifier.java:86)
This happens if ClientData.fetchDataIfNotAvailable() fails to fetch data from the server in CacheData.fetchDynamicData(), resulting in getting the data from the RegionDataConstants with CacheData.getFromRegionDataConstants(). The constants data lacks the id key values that are returned from the server, which are required by FieldVerifier.isCountryKey().
This change fixes this by adding the id value for region constant data from its LookupKey.
It's possible for
StandardAddressVerifier.verifyFields()
to crash with:This happens if
ClientData.fetchDataIfNotAvailable()
fails to fetch data from the server inCacheData.fetchDynamicData()
, resulting in getting the data from theRegionDataConstants
withCacheData.getFromRegionDataConstants()
. The constants data lacks theid
key values that are returned from the server, which are required byFieldVerifier.isCountryKey()
.This change fixes this by adding the
id
value for region constant data from itsLookupKey
.