Check if array is empty

This commit is contained in:
Gustavo Maximiliano Cortez 2015-12-16 16:40:02 -03:00
commit 8c90f6f346
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF

View file

@ -24,7 +24,7 @@ angular.module('copayApp.services').factory('txFormatService', function(profileS
root.processTx = function(tx) {
if (!tx) return;
if (lodash.isArray(tx.outputs) && tx.action != 'received') {
if (lodash.isArray(tx.outputs) && tx.outputs.length > 0 && tx.action != 'received') {
tx.hasMultiplesOutputs = true;
tx.recipientCount = tx.outputs.length;
tx.amount = lodash.reduce(tx.outputs, function(total, o) {