From e6815339ab39bd920e1e32418b39de2f1da75946 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Wed, 3 Dec 2014 13:55:06 -0300 Subject: [PATCH] fix History when there is not transactions --- js/controllers/history.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/controllers/history.js b/js/controllers/history.js index 82c387d12..90b33c783 100644 --- a/js/controllers/history.js +++ b/js/controllers/history.js @@ -90,8 +90,10 @@ angular.module('copayApp.controllers').controller('HistoryController', if (!err && res) { _.each(res, function(r) { var tx = index[r.ts]; - var alternativeAmount = (r.rate != null ? tx.amountSat * rateService.SAT_TO_BTC * r.rate : null); - tx.alternativeAmount = alternativeAmount ? $filter('noFractionNumber')(alternativeAmount, 2) : null; + if (tx) { + var alternativeAmount = (r.rate != null ? tx.amountSat * rateService.SAT_TO_BTC * r.rate : null); + tx.alternativeAmount = alternativeAmount ? $filter('noFractionNumber')(alternativeAmount, 2) : null; + } }); setTimeout(function() { $scope.$digest();