ソースを参照

fix entity voter return value

Olivier Massot 1 年間 前
コミット
db29b0425a
1 ファイル変更1 行追加1 行削除
  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);
     }
 
     /**