Skip to content

Commit

Permalink
Merge pull request #437 from ismaelTartola/issue#436/CheckoutControll…
Browse files Browse the repository at this point in the history
…er-will-Occasionally-throw-a-NULL-Ref-Exception

Issue #436 - SI: CheckoutController will Occasionally throw a NULL Ref Exception
  • Loading branch information
WillStrohl authored Dec 19, 2022
2 parents 716c2b9 + 104713e commit 30a5c75
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ protected bool IsOrderConfirmed
[NonCacheableResponseFilter]
public ActionResult Index()
{
if (CurrentCart == null || CurrentCart.Items == null || CurrentCart.Items.Count == 0)
{
return Redirect(Url.RouteHccUrl(HccRoute.Cart));
}

var model = LoadCheckoutModel();
HccApp.AnalyticsService.RegisterEvent(HccApp.CurrentCustomerId, ActionTypes.GoToChekout, null);
VerifySessionError(model);
Expand Down Expand Up @@ -569,9 +574,6 @@ public ActionResult ApplyEUVatRules()

private CheckoutViewModel LoadCheckoutModel()
{
if (CurrentCart == null || CurrentCart.Items == null || CurrentCart.Items.Count == 0)
Redirect(Url.RouteHccUrl(HccRoute.Cart));

var model = new CheckoutViewModel { CurrentOrder = CurrentCart };

LoadCurrentCustomer(model);
Expand Down

0 comments on commit 30a5c75

Please sign in to comment.