Merge branch '2.8' into 3.2
* 2.8: [VarDumper] ExceptionCaster robustness fix
This commit is contained in:
commit
567652621a
@ -1372,7 +1372,6 @@ class ChoiceTypeTest extends BaseTypeTest
|
||||
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||
'multiple' => true,
|
||||
'choices' => array_flip($this->numericChoicesFlipped),
|
||||
'choices_as_values' => true,
|
||||
));
|
||||
|
||||
$form->submit(array(1, 2));
|
||||
|
@ -67,11 +67,9 @@ class ExceptionCaster
|
||||
$prefix = Caster::PREFIX_PROTECTED;
|
||||
$xPrefix = "\0Exception\0";
|
||||
|
||||
if (isset($a[$xPrefix.'previous'], $a[$xPrefix.'trace'])) {
|
||||
if (isset($a[$xPrefix.'previous'], $a[$xPrefix.'trace']) && $a[$xPrefix.'previous'] instanceof \Exception) {
|
||||
$b = (array) $a[$xPrefix.'previous'];
|
||||
if (isset($a[$prefix.'file'], $a[$prefix.'line'])) {
|
||||
self::traceUnshift($b[$xPrefix.'trace'], get_class($a[$xPrefix.'previous']), $b[$prefix.'file'], $b[$prefix.'line']);
|
||||
}
|
||||
self::traceUnshift($b[$xPrefix.'trace'], get_class($a[$xPrefix.'previous']), $b[$prefix.'file'], $b[$prefix.'line']);
|
||||
$a[$xPrefix.'trace'] = new TraceStub($b[$xPrefix.'trace'], false, 0, -1 - count($a[$xPrefix.'trace']->value));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user