diff --git a/Security/Authorization/Voter/AccessVoter.php b/Security/Authorization/Voter/AccessVoter.php index 359ded8..8ce478b 100644 --- a/Security/Authorization/Voter/AccessVoter.php +++ b/Security/Authorization/Voter/AccessVoter.php @@ -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)) { @@ -174,4 +178,4 @@ private function isExistsObjectByConditions($object, array $conditions, $alias) return $isValid; } -} \ No newline at end of file +}