From 0c85869a1f87cc1c6c4719814482c078ba644c97 Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Tue, 19 Jan 2021 19:21:16 -0500 Subject: [PATCH] Check for parent. Fixes #3132 --- src/Http/Controllers/CP/Collections/EntriesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Http/Controllers/CP/Collections/EntriesController.php b/src/Http/Controllers/CP/Collections/EntriesController.php index e77073f194..00c89aecaa 100644 --- a/src/Http/Controllers/CP/Collections/EntriesController.php +++ b/src/Http/Controllers/CP/Collections/EntriesController.php @@ -179,7 +179,7 @@ public function update(Request $request, $collection, $entry) $entry->afterSave(function ($entry) use ($parent) { $tree = $entry->structure()->in($entry->locale()); - if (optional($tree->page($parent))->isRoot()) { + if ($parent && optional($tree->page($parent))->isRoot()) { $parent = null; }