diff --git a/src/pages/Archive/index.jsx b/src/pages/Archive/index.jsx index 2af7596..4cdc67b 100644 --- a/src/pages/Archive/index.jsx +++ b/src/pages/Archive/index.jsx @@ -105,7 +105,8 @@ export default function Archive({idWell}) { useEffect(() => invokeWebApiWrapperAsync( async () => { - const dates = await TelemetryDataSaubService.getDataDatesRange(idWell) + let dates = await TelemetryDataSaubService.getDataDatesRange(idWell) + if (!dates) dates = {} dates.from = new Date(dates.from ?? (Date.now() - chartInterval)) dates.to = new Date(dates.to ?? Date.now()) const startDate = new Date(Math.max(dates.from, +dates.to - chartInterval))