From 71914188cd206d42ef1afbf7a22b0f0c67301079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Fri, 6 Dec 2024 13:57:33 +0100 Subject: [PATCH] Fix URL previews in chat --- app/Widgets/Chat/Chat.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Widgets/Chat/Chat.php b/app/Widgets/Chat/Chat.php index f586ae3d0..c50feb08e 100644 --- a/app/Widgets/Chat/Chat.php +++ b/app/Widgets/Chat/Chat.php @@ -1362,6 +1362,10 @@ class Chat extends \Movim\Widget\Base } else { $p = new Post(); $message->card = $p->prepareTicket($post); + + if ($message->body == null) { + $message->body = ''; + } } } elseif (isset($message->file) && $message->file->type != 'xmpp') { $message->body = ''; @@ -1376,6 +1380,10 @@ class Chat extends \Movim\Widget\Base if ($resolved) { $message->card = $this->prepareEmbed($resolved); } + + if ($message->body == null) { + $message->body = ''; + } } if ($message->retracted) {