From 69c3eed5fceb9258dc3f62e7bc553b4d9a87a120 Mon Sep 17 00:00:00 2001 From: Bjorn Sandvik Date: Wed, 14 Aug 2024 11:37:21 +0200 Subject: [PATCH] fix: avoid crash when opening map with unsupported Earth Engine layer (#3286) To set the data-test attribute on the LayerCard div we use replace to remove whitespace from the title (introduced in #3021). In some edge cases title can be undefined, and we avoid this error if we set the fallback value to ''. The error occurs for two saved maps with old EE layers that should be removed from from Sierra Leone demo database: * Map: Nighttime lights (AHWtSmx21sx) * Malaria: Cases with elevation eastern area (gJ1BHisY9Wm) Co-authored-by: Jen Jones Arnesen --- src/components/layers/LayerCard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/layers/LayerCard.js b/src/components/layers/LayerCard.js index 1d972a5cd..27457ca5a 100644 --- a/src/components/layers/LayerCard.js +++ b/src/components/layers/LayerCard.js @@ -9,7 +9,7 @@ import styles from './styles/LayerCard.module.css' import LayerToolbar from './toolbar/LayerToolbar.js' const LayerCard = ({ - title, + title = '', subtitle, isOverlay, isExpanded,