Skip to content

Commit 6174ec8

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

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/Twig/EasyAdminTwigExtension.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,12 @@ 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
}
231235

232236
if (method_exists($value, 'getId')) {

0 commit comments

Comments
 (0)