Skip to content

Commit

Permalink
Merge pull request #413 from zoitravel/master
Browse files Browse the repository at this point in the history
Handle null and undefined values in substitutions
  • Loading branch information
thinkingserious authored Aug 9, 2017
2 parents 59ecaa3 + 4d9ea56 commit 3c4f82b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/helpers/mail/mail.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,13 @@ function Personalization() {
this.substitutions = {};
}
var currentKey = Object.keys(substitution)[0];
this.substitutions[currentKey] = substitution[currentKey].toString();
var currentVal = substitution[currentKey];
if (currentVal === null || typeof currentVal === 'undefined') {
this.substitutions[currentKey] = '';
}
else {
this.substitutions[currentKey] = currentVal.toString();
}
};

this.getSubstitutions = function() {
Expand Down

0 comments on commit 3c4f82b

Please sign in to comment.