Sfoglia il codice sorgente

Merge branch 'hotfix/fix_entity_voter_return'

Olivier Massot 1 anno fa
parent
commit
24ff019edd
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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);
     }
 
     /**