From bfb8c1fd12bfa4c2bb137ad42fda1c78ef3edc6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Erik=20St=C3=B8wer?= Date: Mon, 30 Oct 2023 13:49:15 +0100 Subject: [PATCH] tripPattern could be undefined when collapsing itinerary --- client-next/src/components/MapView/LegLines.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client-next/src/components/MapView/LegLines.tsx b/client-next/src/components/MapView/LegLines.tsx index 500bd4ab1aa..41b02ece83a 100644 --- a/client-next/src/components/MapView/LegLines.tsx +++ b/client-next/src/components/MapView/LegLines.tsx @@ -3,10 +3,10 @@ import { Layer, Source } from 'react-map-gl'; import { decode } from '@googlemaps/polyline-codec'; import { getColorForMode } from '../../util/getColorForMode.ts'; -export function LegLines({ tripPattern }: { tripPattern: TripPattern }) { +export function LegLines({ tripPattern }: { tripPattern?: TripPattern }) { return ( <> - {tripPattern.legs.map( + {tripPattern?.legs.map( (leg, i) => leg.pointsOnLink && (