Skip to content

Commit

Permalink
#18164 Checkout - Fix "Cannot read property 'code' on undefined" issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ihor-sviziev committed Oct 9, 2018
1 parent 11d9560 commit e7f70ab
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@ define([

/** @inheritdoc */
initialize: function () {
var steps;

this._super();
$(window).hashchange(_.bind(stepNavigator.handleHash, stepNavigator));

if (!window.location.hash) {
stepNavigator.setHash(stepNavigator.steps().sort(stepNavigator.sortItems)[0].code);
steps = stepNavigator.steps();

if (steps.length) {
stepNavigator.setHash(steps.sort(stepNavigator.sortItems)[0].code);
}
}

stepNavigator.handleHash();
Expand Down

0 comments on commit e7f70ab

Please sign in to comment.