diff --git a/src/Access/PollPolicy.php b/src/Access/PollPolicy.php index 58ab45a9..b58e9dfc 100644 --- a/src/Access/PollPolicy.php +++ b/src/Access/PollPolicy.php @@ -23,7 +23,7 @@ public function seeVoteCount(User $actor, Poll $poll) return $this->deny(); } - if ($poll->myVotes($actor)->count() || $actor->can('polls.viewResultsWithoutVoting', $poll->post ? $poll->post->discussion : null)) { + if ($poll->myVotes($actor)->count() || $actor->can('polls.viewResultsWithoutVoting', $poll->post !== null ? $poll->post->discussion : null)) { return $this->allow(); } } @@ -48,7 +48,7 @@ public function view(User $actor, Poll $poll) public function vote(User $actor, Poll $poll) { - if ($actor->can('polls.vote', $poll->post ? $poll->post->discussion : null) && !$poll->hasEnded()) { + if ($actor->can('polls.vote', $poll->post !== null ? $poll->post->discussion : null) && !$poll->hasEnded()) { return $this->allow(); } } @@ -62,7 +62,7 @@ public function changeVote(User $actor, Poll $poll) public function edit(User $actor, Poll $poll) { - if ($actor->can('polls.moderate', $poll->post ? $poll->post->discussion : null)) { + if ($actor->can('polls.moderate', $poll->post !== null ? $poll->post->discussion : null)) { return $this->allow(); }