Skip to content

Commit 38f97e7

Browse files
authored
Merge pull request #44 from jordy2607/patch-4
Prevent notice showing undefined
2 parents 93efe76 + 67e5607 commit 38f97e7

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)