mirror of
https://github.com/AleziaKurdis/Overte-community-apps.git
synced 2025-04-05 13:37:41 +02:00
Fix exception when preforming election without votes.
This commit is contained in:
parent
b6ab61a28f
commit
2b48831cb7
1 changed files with 4 additions and 1 deletions
|
@ -16,10 +16,10 @@
|
|||
// TODO: Sound for new vote
|
||||
// TODO: Debug mode?
|
||||
// FIXME: Handle ties
|
||||
// FIXME: Running election without votes causes max stack error
|
||||
|
||||
// TODO: Voting results page
|
||||
// TODO: Joining poll sometimes causes to double stack on other clients poll_list?
|
||||
// FIXME: Closing application also prompts for user confirmation. Probably don't want that.
|
||||
|
||||
(() => {
|
||||
"use strict";
|
||||
|
@ -237,6 +237,9 @@
|
|||
voteObject[firstVotes[i]]++
|
||||
}
|
||||
|
||||
// Don't run election if we don't have any votes.
|
||||
if (firstVotes.length == 0) return;
|
||||
|
||||
console.log(`Votes: ${JSON.stringify(voteObject, null, 4)}`);
|
||||
|
||||
// Check to see if there is a majority vote
|
||||
|
|
Loading…
Reference in a new issue