Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Add optional chaining in layerbuilder tempo block (#6717)

Tom Cariello80d3d7b008c6
diff --git a/web/js/map/layerbuilder.js b/web/js/map/layerbuilder.js
index 5b9eef3e5..c22f2be2d 100644
--- a/web/js/map/layerbuilder.js
+++ b/web/js/map/layerbuilder.js
@@ -311,7 +311,7 @@ export default function mapLayerBuilder(config, cache, store) {
options.group = options.group || activeString;
// If layer is a TEMPO layer, fetch updated date ranges
- if (def.id.includes('TEMPO') && !def.tempoDateRanges && tempoCallback) {
+ if (def?.id?.includes('TEMPO') && !def?.tempoDateRanges && tempoCallback) {
tempoCallback(def, [], options.group);
getUpdatedDateRanges(def, tempoCallback, options.group);
}