diff --git a/index.js b/index.js index 5c62dad..efe540a 100644 --- a/index.js +++ b/index.js @@ -241,7 +241,9 @@ function getVoteOrganisedSponsorTimes(sponsorTimes, votes, UUIDs) { } //if there are too many indexes, find the best 4 - finalSponsorTimeIndexes = getWeightedRandomChoice(finalSponsorTimeIndexes, votes, 4).finalChoices; + if (finalSponsorTimeIndexes.length > 4) { + finalSponsorTimeIndexes = getWeightedRandomChoice(finalSponsorTimeIndexes, votes, 4).finalChoices; + } //convert this to a final array to return let finalSponsorTimes = [];