fixes null attachment bug
This commit is contained in:
parent
80662a6c9e
commit
a080748677
|
@ -81,8 +81,10 @@ class ArchiveSiteMetaViewHelper extends AbstractHelper
|
||||||
foreach ($page->blocks() as $block) {
|
foreach ($page->blocks() as $block) {
|
||||||
if ($block->layout() === 'archiveSiteMeta') {
|
if ($block->layout() === 'archiveSiteMeta') {
|
||||||
$attachments = $block->attachments();
|
$attachments = $block->attachments();
|
||||||
$media = $attachments[0]->item()->media()[0];
|
if ($attachments) {
|
||||||
return $media->primaryMedia()->thumbnailUrl('large');
|
$media = $attachments[0]->item()->media()[0];
|
||||||
|
return $media->primaryMedia()->thumbnailUrl('large');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue