You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a returning customer has entered a couponcode which no longer exists accessing, the cart can cause a crash due to the following lines in ShoppingCartModelFactory:
If a returning customer has entered a couponcode which no longer exists accessing, the cart can cause a crash due to the following lines in ShoppingCartModelFactory:
var discount = _discountService.GetAllDiscountsForCaching(couponCode: couponCode)
.FirstOrDefault(d => d.RequiresCouponCode && _discountService.ValidateDiscount(d, _workContext.CurrentCustomer).IsValid);
model.DiscountBox.AppliedDiscountsWithCodes.Add(new ShoppingCartModel.DiscountBoxModel.DiscountInfoModel()
{
Id = discount.Id,
CouponCode = discount.CouponCode
});
The discount in this case is null.
Source: http://www.nopcommerce.com/boards/t/47053/missing-null-check-causes-crash-in-cart.aspx
The text was updated successfully, but these errors were encountered: