SelectBillingAddress method exception

Posted: September 10, 2018 at 8:14 AM Quote #211733
nopCommerce version: 4.1

In SelectBillingAddress method of checkout controller we face with an exception if address.Country is null. The code which cause an exception is:

if (_shippingSettings.ShipToSameAddress && shipToSameAddress && _shoppingCartService.ShoppingCartRequiresShipping(cart) && address.Country.AllowsShipping)


We think that checking for address.Country != null is missing.

We submit an issue for this bug here.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
ResanehLab, Digital Agency
E-commerce solutions
nopCommerec solution partner
-------------------------------
Website: resanehlab.com/en
Posted: September 11, 2018 at 1:36 AM Quote #211757
resanehlab wrote:
We think that checking for address.Country != null is missing.

Thanks a lot! Actually it can be null in some cases. I think we should also check whether "Country" address field is enabled. And when enabled, we should make null validation
This post/answer is useful
2
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Interested in the dedicated Premium support services provided by core developers? Please visit http://www.nopcommerce.com/supportservices.aspx

Regards,
Andrei Mazulnitsyn
Posted: September 11, 2018 at 2:53 AM Quote #211763
Thanks, that's true. Also seems this can cause some exceptions in FindAddress method of address service when a.CountryId is null but countryId has value.

((a.CountryId == null && countryId == null) || a.CountryId.Value == countryId.Value)


This also happens for StateProvince.

Regards
This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
ResanehLab, Digital Agency
E-commerce solutions
nopCommerec solution partner
-------------------------------
Website: resanehlab.com/en
Posted: September 14, 2018 at 4:46 AM Quote #211916
Done. Please see this commit for more details.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Regards,
Dmitriy Kulagin
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.
eCommerce CONFERENCE 2018
Learn more