From 1383cede36666ad4f1ddb8f959a32cc71f6d1ae6 Mon Sep 17 00:00:00 2001 From: Hamza Mahjoubi Date: Thu, 15 Aug 2024 11:38:34 +0200 Subject: [PATCH] fix: pollId equals 0 Signed-off-by: Hamza Mahjoubi --- lib/Service/WatchService.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Service/WatchService.php b/lib/Service/WatchService.php index 56abb5c3b..170d85e98 100644 --- a/lib/Service/WatchService.php +++ b/lib/Service/WatchService.php @@ -36,8 +36,11 @@ class WatchService { * Watch poll for updates */ public function watchUpdates(int $pollId, ?int $offset = null): array { - $this->pollMapper->find($pollId)->request(Poll::PERMISSION_POLL_VIEW); + if($pollId !== 0) { + $this->pollMapper->find($pollId)->request(Poll::PERMISSION_POLL_VIEW); + } + $start = time(); $timeout = 30; $offset = $offset ?? $start;