Skip to content

Commit

Permalink
There's no parent if the entry being localized is the root. (e.g. a h…
Browse files Browse the repository at this point in the history
…ome page)
  • Loading branch information
jasonvarga committed Oct 8, 2020
1 parent a8f3f47 commit c9f0255
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private function addToStructure($collection, $entry, $localized)
}

$tree = $structure->in($localized->locale());
$parent = $entry->parent()->in($localized->locale());
$parent = optional($entry->parent())->in($localized->locale());

$localized->afterSave(function ($localized) use ($parent, $tree) {
if (! $parent || $parent->isRoot()) {
Expand Down

0 comments on commit c9f0255

Please sign in to comment.