From 7ee88c45de8e0186cedcc644abbb5c73c2c6024b Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 22 Jan 2019 18:01:28 +0100 Subject: [PATCH] Prevent errors caused by unknown media objects --- .../embedded/object/MediaMessageEmbeddedObjectHandler.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php b/wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php index efbf8dbf59..3fbbcc2ef6 100644 --- a/wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php +++ b/wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php @@ -46,7 +46,7 @@ class MediaMessageEmbeddedObjectHandler extends AbstractSimpleMessageEmbeddedObj if ($contentLanguageID !== null) { $mediaIDs = []; foreach ($viewableMedia as $media) { - if ($media->localizedLanguageID != $contentLanguageID) { + if ($media !== null && $media->localizedLanguageID != $contentLanguageID) { $mediaIDs[] = $media->getDecoratedObject()->mediaID; } } -- 2.20.1