|
Hi,
I'm getting an NPE in EbayOrderServices.createShoppingCart (line 1118ff,
trunk r982144).
The call to PartyWorker.findMatchingPersonPostalAddresses fails due to a
missing entry of "stateProvinceGeoId" in shippingAddressCtx.
>> shippingAddressCtx.get("stateProvinceGeoId").toString() =>
null.toString()
List<GenericValue> shipInfo =
PartyWorker.findMatchingPersonPostalAddresses(delegator,
shippingAddressCtx.get("shippingAddressStreet1").toString(),
(UtilValidate.isEmpty(shippingAddressCtx.get("shippingAddressStreet2")) ?
null : shippingAddressCtx.get("shippingAddressStreet2").toString()),
shippingAddressCtx.get("city").toString(),
shippingAddressCtx.get("stateProvinceGeoId").toString(),shippingAddressCtx.g
et("shippingAddressPostalCode").toString(), null,
shippingAddressCtx.get("countryGeoId").toString(), firstName, null,
lastName);
A previous call to EbayHelper.correctCityStateCountry puts this property
only for "USA" and "CAN"
if (geoId.equals("USA") || geoId.equals("CAN")) {
if (UtilValidate.isNotEmpty(state)) {
map.put("stateProvinceGeoId", state.toUpperCase());
}
Adding "stateProvinceGeoId" with a default value ("") for other geoIds, or
checking whether it's empty (like it's done for other properties) should
solve this problem.
Thanks a lot
Norbert
|