Skip to content

Commit 35b1116

Browse files
ENGCOM-3153: Checkout - Fix 'Cannot read property 'code' on undefined' issue #18494
- Merge Pull Request #18494 from ihor-sviziev/magento2:2.3-checkout-fix-cannot-read-property-code-of-undefined - Merged commits: 1. 47978d7 2. 0fcbe12
2 parents de50d12 + 0fcbe12 commit 35b1116

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
@@ -23,11 +23,17 @@ define([
2323

2424
/** @inheritdoc */
2525
initialize: function () {
26+
var stepsValue;
27+
2628
this._super();
2729
window.addEventListener('hashchange', _.bind(stepNavigator.handleHash, stepNavigator));
2830

2931
if (!window.location.hash) {
30-
stepNavigator.setHash(stepNavigator.steps().sort(stepNavigator.sortItems)[0].code);
32+
stepsValue = stepNavigator.steps();
33+
34+
if (stepsValue.length) {
35+
stepNavigator.setHash(stepsValue.sort(stepNavigator.sortItems)[0].code);
36+
}
3137
}
3238

3339
stepNavigator.handleHash();

0 commit comments

Comments
 (0)