8000 [Twig] Add missing check · symfony/symfony@5b5b7de · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b5b7de

Browse files
committed
[Twig] Add missing check
1 parent 85d1011 commit 5b5b7de

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Bridge/Twig/Mime/NotificationEmail.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ public function importance(string $importance)
105105
*/
106106
public function exception($exception)
107107
{
108+
if (!$exception instanceof \Throwable && !$exception instanceof FlattenException) {
109+
throw new \LogicException(sprintf('"%s" accepts "%s" or "%s" instances.', __METHOD__, \Throwable::class, FlattenException::class));
110+
}
111+
108112
$exceptionAsString = $this->getExceptionAsString($exception);
109113

110114
$this->context['exception'] = true;

0 commit comments

Comments
 (0)
0