diff --git a/packages/twenty-front/src/modules/command-menu/pages/record-page/components/CommandMenuRecordPage.tsx b/packages/twenty-front/src/modules/command-menu/pages/record-page/components/CommandMenuRecordPage.tsx index 659c37d90..e1f8c6262 100644 --- a/packages/twenty-front/src/modules/command-menu/pages/record-page/components/CommandMenuRecordPage.tsx +++ b/packages/twenty-front/src/modules/command-menu/pages/record-page/components/CommandMenuRecordPage.tsx @@ -37,9 +37,13 @@ export const CommandMenuRecordPage = () => { throw new Error(`Object name is not defined`); } + if (!viewableRecordId) { + throw new Error(`Record id is not defined`); + } + const { objectNameSingular, objectRecordId } = useRecordShowPage( - viewableRecordNameSingular ?? '', - viewableRecordId ?? '', + viewableRecordNameSingular, + viewableRecordId, ); const commandMenuPageInstanceId = useComponentInstanceStateContext(