Browse Source

try catch on formatAmount

activeAddress
Ivan Socolsky 10 years ago
parent
commit
cbb1645369
  1. 6
      lib/emailservice.js
  2. 2
      package.json

6
lib/emailservice.js

@ -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
package.json

@ -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…
Cancel
Save