try catch on formatAmount
This commit is contained in:
parent
8660f3b4a4
commit
cbb1645369
|
@ -193,7 +193,11 @@ EmailService.prototype._getDataForTemplate = function(notification, recipient, c
|
|||
var data = _.cloneDeep(notification.data);
|
||||
data.subjectPrefix = _.trim(self.subjectPrefix) + ' ';
|
||||
if (data.amount) {
|
||||
data.amount = WalletUtils.formatAmount(+data.amount, recipient.unit) + ' ' + recipient.unit;
|
||||
try {
|
||||
data.amount = WalletUtils.formatAmount(+data.amount, recipient.unit) + ' ' + recipient.unit;
|
||||
} catch (ex) {
|
||||
return cb(new Error('Could not format amount', ex));
|
||||
}
|
||||
}
|
||||
self.storage.fetchWallet(notification.walletId, function(err, wallet) {
|
||||
if (err) return cb(err);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "bitcore-wallet-service",
|
||||
"description": "A service for Mutisig HD Bitcoin Wallets",
|
||||
"author": "BitPay Inc",
|
||||
"version": "0.0.39",
|
||||
"version": "0.0.40",
|
||||
"keywords": [
|
||||
"bitcoin",
|
||||
"copay",
|
||||
|
|
Loading…
Reference in New Issue