From d6c6184454e4a4852d0ba71300d95c933a4dd3c6 Mon Sep 17 00:00:00 2001 From: edalzell Date: Mon, 9 Jun 2025 20:48:47 -0700 Subject: [PATCH] ensure string --- src/Types/Event.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Types/Event.php b/src/Types/Event.php index 06a23b4..9a45788 100644 --- a/src/Types/Event.php +++ b/src/Types/Event.php @@ -144,7 +144,15 @@ protected function location(Entry $event): ?string $locationField = config("events.collections.$collectionHandle.location_field", 'location'); - return $event->{$locationField}; + if (is_null($location = $event->{$locationField})) { + return null; + } + + if (! is_string($location)) { + return null; + } + + return $location; } protected function supplement(CarbonInterface $date): ?Entry