Prevent errors caused by unknown media objects
authorAlexander Ebert <ebert@woltlab.com>
Tue, 22 Jan 2019 17:01:28 +0000 (18:01 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 22 Jan 2019 17:01:28 +0000 (18:01 +0100)
wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php

index efbf8dbf5961bb44d6e4b91d6425cef291b78e50..3fbbcc2ef63c9d67769a8d01b657efe0165f0093 100644 (file)
@@ -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;
                                }
                        }