From b9295128fdab61ea4d28c77967efa8cbf0150c5d Mon Sep 17 00:00:00 2001 From: Maximilian Harz Date: Mon, 10 Feb 2025 23:40:45 +0100 Subject: [PATCH] Add ? to item references --- src/Components/Map/Subcomponents/Controls/SearchControl.tsx | 2 +- src/Components/Map/UtopiaMapInner.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/Map/Subcomponents/Controls/SearchControl.tsx b/src/Components/Map/Subcomponents/Controls/SearchControl.tsx index 68aaf51e..e197ea03 100644 --- a/src/Components/Map/Subcomponents/Controls/SearchControl.tsx +++ b/src/Components/Map/Subcomponents/Controls/SearchControl.tsx @@ -75,7 +75,7 @@ export const SearchControl = () => { return ( value.length > 2 && ((item.layer?.listed && item.name.toLowerCase().includes(value.toLowerCase())) || - item.text.toLowerCase().includes(value.toLowerCase())) + item.text?.toLowerCase().includes(value.toLowerCase())) ) }), ) diff --git a/src/Components/Map/UtopiaMapInner.tsx b/src/Components/Map/UtopiaMapInner.tsx index 0c3b3d2b..58bb2b86 100644 --- a/src/Components/Map/UtopiaMapInner.tsx +++ b/src/Components/Map/UtopiaMapInner.tsx @@ -147,7 +147,7 @@ export function UtopiaMapInner({ ?.setAttribute('content', ref.item.name) document .querySelector('meta[property="og:description"]') - ?.setAttribute('content', ref.item.text) + ?.setAttribute('content', ref.item.text ?? '') } } }