Skip to content

Commit aafa0af

Browse files
committed
Restore BC by wrapping the to string in a try catch block
1 parent 8205de9 commit aafa0af

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/Twig/EasyAdminTwigExtension.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,14 @@ public function representAsString(mixed $value, string|callable|null $toStringMe
225225
return $value->trans($this->translator);
226226
}
227227

228-
if ($value instanceof \Stringable) {
229-
return (string) $value;
228+
try {
229+
if ($value instanceof \Stringable) {
230+
return (string) $value;
231+
}
232+
} catch (\RuntimeException) {
233+
return '';
230234
}
231-
235+
232236
if (method_exists($value, 'getId')) {
233237
return sprintf(
234238
'%s #%s',

0 commit comments

Comments
 (0)