about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-05-26 22:06:10 +0200
committerGitHub <noreply@github.com>2022-05-26 22:06:10 +0200
commit1ff4877945e18820f3e518a1cfbac243da65e1a5 (patch)
treeb71087d53c1a3edef8a26173e4957590bf7669c2 /app
parent976cd6413e9b2a1531a2ad17945342deaeec538c (diff)
Fix empty votes arbitrarily increasing voters count in polls (#18526)
Diffstat (limited to 'app')
-rw-r--r--app/services/vote_service.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/services/vote_service.rb b/app/services/vote_service.rb
index ccd04dbfc..114ec285c 100644
--- a/app/services/vote_service.rb
+++ b/app/services/vote_service.rb
@@ -7,6 +7,8 @@ class VoteService < BaseService
   include Lockable
 
   def call(account, poll, choices)
+    return if choices.empty?
+
     authorize_with account, poll, :vote?
 
     @account = account