diff --git a/modules/custom/az_paragraphs/src/Plugin/Field/FieldFormatter/AZBackgroundMediaFormatter.php b/modules/custom/az_paragraphs/src/Plugin/Field/FieldFormatter/AZBackgroundMediaFormatter.php index f1a70247b1..bf87702766 100644 --- a/modules/custom/az_paragraphs/src/Plugin/Field/FieldFormatter/AZBackgroundMediaFormatter.php +++ b/modules/custom/az_paragraphs/src/Plugin/Field/FieldFormatter/AZBackgroundMediaFormatter.php @@ -584,6 +584,9 @@ protected function image(array $settings, MediaInterface $media): array { $css_settings = $settings['css_settings']; $fid = $media->getSource()->getSourceFieldValue($media); $file = $this->entityTypeManager->getStorage('file')->load($fid); + if (empty($file)) { + return $az_background_media; + } $file_uri = $file->getFileUri(); if ($settings['style'] !== 'bottom') {