Skip to content

Commit d9c3a92

Browse files
author
Stanislav Idolov
authored
ENGCOM-3154: [Backport] Checkout - Fix "Cannot read property 'code' on undefined" issue #18495
2 parents df87365 + a0b13a0 commit d9c3a92

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/code/Magento/Checkout/view/frontend/web/js/view/progress-bar.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,17 @@ define([
2424

2525
/** @inheritdoc */
2626
initialize: function () {
27+
var stepsValue;
28+
2729
this._super();
2830
$(window).hashchange(_.bind(stepNavigator.handleHash, stepNavigator));
2931

3032
if (!window.location.hash) {
31-
stepNavigator.setHash(stepNavigator.steps().sort(stepNavigator.sortItems)[0].code);
33+
stepsValue = stepNavigator.steps();
34+
35+
if (stepsValue.length) {
36+
stepNavigator.setHash(stepsValue.sort(stepNavigator.sortItems)[0].code);
37+
}
3238
}
3339

3440
stepNavigator.handleHash();

0 commit comments

Comments
 (0)