I ‘m developing an application which will search for a product & retrieve all details like sellerInfo,shippingInfo,price,etc…However ,I’m getting error “Object reference not set to an instance of an object” while retrieving seller username & shippingInfo with the following syntax: This is for shipping cost:
SearchItem[] items = response.searchResult.item;
double shippingcost=items[i].shippingInfo.shippingServiceCost.Value.
This is for sellerInfo:
string sellerInfo = items[i].sellerInfo.sellerUserName;
Please help,The control is going directly to catch block & raising exception. I tried checking for the null using if condition but no success its raising exception.
2
Answers
I solved this myself.What I did is I created an Object of shipping info like the above:
Thanks to all for reply & your efforts.
Regards Rishiraj M Shengule [email protected]
Please Check the
null
Values as:Hope this helps you!