diff --git a/frontend/src/container/GridCardLayout/GridCard/FullView/index.tsx b/frontend/src/container/GridCardLayout/GridCard/FullView/index.tsx index 7511a4d445..974a35a39c 100644 --- a/frontend/src/container/GridCardLayout/GridCard/FullView/index.tsx +++ b/frontend/src/container/GridCardLayout/GridCard/FullView/index.tsx @@ -140,7 +140,7 @@ function FullView({ const [graphsVisibilityStates, setGraphsVisibilityStates] = useState< boolean[] - >(Array(response.data?.payload.data.result.length).fill(true)); + >(Array(response.data?.payload?.data?.result?.length).fill(true)); useEffect(() => { const { diff --git a/frontend/src/hooks/queryBuilder/useFetchKeysAndValues.ts b/frontend/src/hooks/queryBuilder/useFetchKeysAndValues.ts index 6fd42175ad..7b99b9d250 100644 --- a/frontend/src/hooks/queryBuilder/useFetchKeysAndValues.ts +++ b/frontend/src/hooks/queryBuilder/useFetchKeysAndValues.ts @@ -70,7 +70,7 @@ export const useFetchKeysAndValues = ( const queryFiltersWithoutId = useMemo( () => ({ ...query.filters, - items: query.filters.items.map((item) => { + items: query.filters?.items?.map((item) => { const filterWithoutId = cloneDeep(item); unset(filterWithoutId, 'id'); return filterWithoutId; diff --git a/frontend/src/pages/LogsExplorer/index.tsx b/frontend/src/pages/LogsExplorer/index.tsx index 9e23b34c2c..5e4d1cf55f 100644 --- a/frontend/src/pages/LogsExplorer/index.tsx +++ b/frontend/src/pages/LogsExplorer/index.tsx @@ -67,7 +67,7 @@ function LogsExplorer(): JSX.Element { } if ( currentQuery.builder.queryData.length === 1 && - currentQuery.builder.queryData[0].groupBy.length > 0 + currentQuery.builder.queryData?.[0]?.groupBy?.length > 0 ) { handleChangeSelectedView(SELECTED_VIEWS.QUERY_BUILDER); }