Skip to content

Commit

Permalink
handle null and undefined values
Browse files Browse the repository at this point in the history
  • Loading branch information
chamini2 committed Jul 27, 2017
1 parent eb7bce7 commit 4d9ea56
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 4d9ea56

Please sign in to comment.