Skip to content

Commit

Permalink
backwards compatibility with non tally contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
santisiri committed Apr 27, 2018
1 parent 318f798 commit 53e3d92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions imports/ui/templates/components/decision/ballot/ballot.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,13 @@ Template.ballot.helpers({
let label = '';
switch (button) {
case 'vote':
if (this.contract.tally.voter.length > 1) {
if (this.contract.tally && this.contract.tally.voter.length > 1) {
label = ${_.reduce(this.contract.tally.voter, function (memo, voter) {
let votes = 0;
votes = parseInt(memo.votes + voter.votes, 10);
return votes;
})}`;
} else if (this.contract.tally.voter.length === 1) {
} else if (this.contract.tally && this.contract.tally.voter.length === 1) {
label += ${(this.contract.tally.voter[0].votes)}`;
}
break;
Expand Down

0 comments on commit 53e3d92

Please sign in to comment.