From ac4178bd367b467e0d99da1100dc2f2500a940a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 22 Feb 2023 17:31:20 +0100 Subject: [PATCH] Gracefully handle deleted messages in MessageAttachmentObjectType --- LICENSE | 2 +- .../attachment/MessageAttachmentObjectType.class.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index bcc0fb3..888079e 100644 --- a/LICENSE +++ b/LICENSE @@ -10,7 +10,7 @@ Additional Use Grant: You may use the Licensed Work when your application uses the Licensed Work for a purpose that does neither directly or indirectly generate revenue. -Change Date: 2027-02-02 +Change Date: 2027-02-22 Change License: Version 2 or later of the GNU General Public License as published by the Free Software Foundation. diff --git a/files/lib/system/attachment/MessageAttachmentObjectType.class.php b/files/lib/system/attachment/MessageAttachmentObjectType.class.php index 7475c8f..6afbc94 100644 --- a/files/lib/system/attachment/MessageAttachmentObjectType.class.php +++ b/files/lib/system/attachment/MessageAttachmentObjectType.class.php @@ -1,12 +1,12 @@ messageID) { + return false; + } + \assert($message->getMessageType()->objectType === 'be.bastelstu.chat.messageType.attachment'); $room = $message->getRoom();