Skip to content

Commit d4c983e

Browse files
Fix: bounding box undefined causing white screen of death (#1416)
* stricter handling of bounding box null * stricter handling of bounding box undefined
1 parent 3457d0f commit d4c983e

File tree

2 files changed

+421
-311
lines changed

2 files changed

+421
-311
lines changed

web-app/src/app/components/CoveredAreaMap.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,11 @@ const CoveredAreaMap: React.FC<CoveredAreaMapProps> = ({
197197
const displayGtfsVisualizationView =
198198
view === 'gtfsVisualizationView' && feed?.data_type === 'gtfs';
199199

200-
if (displayBoundingBoxMap) {
201-
return <Map polygon={boundingBox ?? []} />;
200+
if (displayBoundingBoxMap && boundingBox != undefined) {
201+
return <Map polygon={boundingBox} />;
202202
}
203203

204-
if (displayGtfsVisualizationView) {
204+
if (displayGtfsVisualizationView && boundingBox != undefined) {
205205
return (
206206
<>
207207
<Fab
@@ -213,7 +213,7 @@ const CoveredAreaMap: React.FC<CoveredAreaMapProps> = ({
213213
<ZoomOutMapIcon></ZoomOutMapIcon>
214214
</Fab>
215215
<GtfsVisualizationMap
216-
polygon={boundingBox ?? []}
216+
polygon={boundingBox}
217217
latestDataset={latestDataset}
218218
dataDisplayLimit={config.visualizationMapPreviewDataLimit}
219219
preview={true}

0 commit comments

Comments
 (0)