Merge branch '3.2'

* 3.2:
  [VarDumper] ExceptionCaster robustness fix
This commit is contained in:
Nicolas Grekas 2017-03-12 17:08:03 +01:00
commit 40d133c29a
2 changed files with 1 additions and 2 deletions

View File

@ -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));

View File

@ -67,7 +67,7 @@ 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'];
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, -count($a[$xPrefix.'trace']->value));