From: Alexander Ebert Date: Tue, 22 Jan 2019 17:01:28 +0000 (+0100) Subject: Prevent errors caused by unknown media objects X-Git-Tag: 3.1.8~18 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7ee88c45de8e0186cedcc644abbb5c73c2c6024b;p=GitHub%2FWoltLab%2FWCF.git Prevent errors caused by unknown media objects --- 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; } }