Merge pull request #3650 from nextcloud/fix/poll-id-0

fix: pollId equals 0
This commit is contained in:
Hamza 2024-08-22 22:46:34 +02:00 коммит произвёл GitHub
Родитель 82f780b462 1383cede36
Коммит fb36605219
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -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;