Skip to content

Commit a0b13a0

Browse files
ENGCOM-3154: [Backport] Checkout - Fix 'Cannot read property 'code' on undefined' issue #18495
- Merge Pull Request #18495 from ihor-sviziev/magento2:checkout-fix-cannot-read-property-code-of-undefined - Merged commits: 1. e7f70ab 2. 25e3cfe
2 parents 74aa43b + 25e3cfe commit a0b13a0

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)