Skip to content

Commit

Permalink
Catch missing summaries on api data (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfdsilva authored Dec 4, 2023
2 parents 125e278 + 0258447 commit 44f6345
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/scripts/context/layer-data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ const fetchLayerById = async (
}
};
} else {
const domain = data.summaries
const domain = data.summaries?.datetime?.[0]
? data.summaries.datetime
: data.extent.temporal.interval[0];

if (domain.some((d) => !d)) {
throw new Error('Invalid datetime domain');
}

return {
timeseries: {
...commonTimeseriesParams,
Expand Down

0 comments on commit 44f6345

Please sign in to comment.