Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6831b98

Browse files
[VarDumper] ExceptionCaster robustness fix
1 parent 641092f commit 6831b98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static function castThrowingCasterException(ThrowingCasterException $e, a
6464
$prefix = Caster::PREFIX_PROTECTED;
6565
$xPrefix = "\0Exception\0";
6666

67-
if (isset($a[$xPrefix.'previous'], $a[$xPrefix.'trace'][0])) {
67+
if (isset($a[$xPrefix.'previous'], $a[$xPrefix.'trace'][0]) && $a[$xPrefix.'previous'] instanceof \Exception) {
6868
$b = (array) $a[$xPrefix.'previous'];
6969
$b[$xPrefix.'trace'][0] += array(
7070
'file' => $b[$prefix.'file'],

0 commit comments

Comments
 (0)