Explorar o código

fix entity voter return value

Olivier Massot hai 1 ano
pai
achega
db29b0425a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Security/Voter/EntityVoter/AbstractEntityVoter.php

+ 1 - 1
src/Security/Voter/EntityVoter/AbstractEntityVoter.php

@@ -72,7 +72,7 @@ abstract class AbstractEntityVoter extends Voter
             throw new \RuntimeException('Setup the self::$entityClass property, or override the supports() method');
         }
 
-        return $subject::class === static::$entityClass && in_array($attribute, static::$allowedOperations);
+        return $subject !== null && $subject::class === static::$entityClass && in_array($attribute, static::$allowedOperations);
     }
 
     /**