Skip to content

The open alternative to Salesforce, designed for AI.

Throw error if attempting to open RecordPage without recordId (#11768)

Marie0881e35d649f
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 659c37d90df..e1f8c6262af 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(