[Twig] Add missing check

This commit is contained in:
Fabien Potencier 2019-09-19 14:48:09 +02:00
parent 85d10114e0
commit 5b5b7de660

View File

@ -105,6 +105,10 @@ class NotificationEmail extends TemplatedEmail
*/
public function exception($exception)
{
if (!$exception instanceof \Throwable && !$exception instanceof FlattenException) {
throw new \LogicException(sprintf('"%s" accepts "%s" or "%s" instances.', __METHOD__, \Throwable::class, FlattenException::class));
}
$exceptionAsString = $this->getExceptionAsString($exception);
$this->context['exception'] = true;