From d66d2bccfb50a5d4717ed7a65542f094c5a87d43 Mon Sep 17 00:00:00 2001 From: John Koster Date: Sat, 30 Mar 2024 16:14:50 -0500 Subject: [PATCH] Fallback to empty array if no entry --- src/Stache/Stores/BasicStore.php | 2 +- src/Structures/Page.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Stache/Stores/BasicStore.php b/src/Stache/Stores/BasicStore.php index 44b28a7a6b..c39fe0e263 100644 --- a/src/Stache/Stores/BasicStore.php +++ b/src/Stache/Stores/BasicStore.php @@ -86,7 +86,7 @@ protected function getCachedItem($key) foreach ($item->receivesIndexValues() as $index) { Stache::itemUsingIndexValues($index, $item); - $value = $this->resolveIndex($index)->get($id); + $value = $this->resolveIndex($index)->load()->get($id); if ($value) { $item->withIndexedValue($index, $value); diff --git a/src/Structures/Page.php b/src/Structures/Page.php index f5a937d8e0..ab90ea0d55 100644 --- a/src/Structures/Page.php +++ b/src/Structures/Page.php @@ -425,7 +425,7 @@ public function routeData() return $this->routeData; } - return $this->routeData = $this->entry()->routeData(); + return $this->routeData = $this->entry()?->routeData() ?? []; } public function published()