Skip to content

The open alternative to Salesforce, designed for AI.

Fix undefined state from react-router-dom. (#6293)

Lucas Bordeau8833a38db5e1
diff --git a/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts b/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
index 15092daba47..0909fcf78cd 100644
--- a/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
+++ b/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
@@ -115,7 +115,7 @@ export const useRecordShowPagePagination = (
const { state } = useLocation();
- const cursorFromIndexPage = state.cursor;
+ const cursorFromIndexPage = state?.cursor;
const { loading: loadingCurrentRecord, pageInfo: currentRecordsPageInfo } =
useFindManyRecords({