NPE in EbayOrderServices.createShoppingCart in trunk r982144

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

NPE in EbayOrderServices.createShoppingCart in trunk r982144

nrieger
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

 

Reply | Threaded
Open this post in threaded view
|

Re: NPE in EbayOrderServices.createShoppingCart in trunk r982144

Erwan de FERRIERES
Le 08/09/2010 16:34, Norbert Rieger a écrit :
> Hi,
>
>
>
> I'm getting an NPE in EbayOrderServices.createShoppingCart (line 1118ff,
> trunk r982144).

hi Norbert,

could you create a jira issue and provide a patch ?

Thanks,

--
Erwan de FERRIERES
www.nereide.biz