Skip to content

Commit 3679d39

Browse files
committed
fix: handle potential null value for ancestors in SeoDto
1 parent e4058e3 commit 3679d39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Dtos/SeoDto.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function __toString(): string
187187
{
188188
$html = '';
189189

190-
$parentSeo = $this->ancestors->filter()->last();
190+
$parentSeo = ($this->ancestors ?? collect())->filter()->last();
191191

192192
if ($this->title) {
193193
$title = $this->title;

0 commit comments

Comments
 (0)