Skip to content

Commit

Permalink
Fix bug with AccessVoter
Browse files Browse the repository at this point in the history
  • Loading branch information
nilov authored Jun 18, 2019
1 parent 9ef2ec5 commit 67fb284
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Security/Authorization/Voter/AccessVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ public function supportsClass($class)
*/
public function vote(TokenInterface $token, $object, array $attributes)
{
if (!is_object($object)) {
return VoterInterface::ACCESS_ABSTAIN;
}

$class = get_class($object);

if (!$this->supportsClass($class)) {
Expand Down Expand Up @@ -174,4 +178,4 @@ private function isExistsObjectByConditions($object, array $conditions, $alias)

return $isValid;
}
}
}

0 comments on commit 67fb284

Please sign in to comment.