From 7ffd7f0b21cad701973f64b6541b8408e4fbd53e Mon Sep 17 00:00:00 2001
From: Thomas Citharel <tcit@tcit.fr>
Date: Mon, 19 Mar 2018 10:23:35 +0100
Subject: [PATCH] Fix unable to vote with ConcurrentVoteException when ValueMax
 is null

Closes #276

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
---
 app/classes/Framadate/Services/PollService.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/classes/Framadate/Services/PollService.php b/app/classes/Framadate/Services/PollService.php
index 1adc6f8c..165a9242 100644
--- a/app/classes/Framadate/Services/PollService.php
+++ b/app/classes/Framadate/Services/PollService.php
@@ -296,7 +296,7 @@ class PollService {
         $best_choices = $this->computeBestChoices($votes);
         foreach ($best_choices['y'] as $i => $nb_choice) {
             // if for this option we have reached maximum value and user wants to add itself too
-            if ($nb_choice >= $poll->ValueMax && $user_choice[$i] === "2") {
+	     if ($poll->ValueMax != null && $nb_choice >= $poll->ValueMax && $user_choice[$i] === "2") {
                 throw new ConcurrentVoteException();
             }
         }
-- 
GitLab