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