Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Form/Type/DynamicFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use FormBuilderBundle\Form\Data\FormData;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\CallbackTransformer;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormError;
Expand Down Expand Up @@ -89,7 +90,11 @@ function ($runtimeData) {
return is_array($runtimeData) ? json_encode($runtimeData, JSON_THROW_ON_ERROR) : null;
},
function ($runtimeData) {
return empty($runtimeData) ? null : json_decode($runtimeData, true, 512, JSON_THROW_ON_ERROR);
try {
return empty($runtimeData) ? null : json_decode($runtimeData, true, 512, JSON_THROW_ON_ERROR);
} catch (\jsonException $e) {
throw new TransformationFailedException('', 0, $e);
}
}
));

Expand Down