Skip to content

Commit 67e5607

Browse files
authored
Prevent notice showing undefined
1 parent 93efe76 commit 67e5607

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

view/frontend/web/js/view/form/postcode.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,15 @@ define([
496496
preview += street + ' ';
497497
});
498498

499-
preview += "<br/>" + address.postcode + "<br/>";
500-
preview += address.city;
501-
preview += "</i>"
499+
if (address.postcode) {
500+
preview += "<br/>" + address.postcode + "<br/>";
501+
}
502+
503+
if (address.city) {
504+
preview += address.city;
505+
}
506+
507+
preview += "</i>";
502508

503509
this.notice(preview);
504510
},

0 commit comments

Comments
 (0)