Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Optional chaining to safely handle (#6648)

Tom Cariello839a4f4e4752
diff --git a/web/js/containers/sidebar/layer-row.js b/web/js/containers/sidebar/layer-row.js
index 0e7d90e0a..cbb7dbf6e 100644
--- a/web/js/containers/sidebar/layer-row.js
+++ b/web/js/containers/sidebar/layer-row.js
@@ -190,7 +190,7 @@ function LayerRow (props) {
const requests = [cmrFetch(olderUrl), cmrFetch(newerUrl)];
const responses = await Promise.allSettled(requests);
const [olderRes, newerRes] = responses.filter(({ status }) => status === 'fulfilled').map(({ value }) => value);
- if (!olderRes.ok || !newerRes.ok) return;
+ if (!olderRes?.ok || !newerRes?.ok) return;
const jsonRequests = [olderRes.json(), newerRes.json()];
const jsonResponses = await Promise.allSettled(jsonRequests);
const [olderGranules, newerGranules] = jsonResponses.filter(({ status }) => status === 'fulfilled').map(({ value }) => value);