diff --git a/frontend/common/utils/utils.tsx b/frontend/common/utils/utils.tsx index 88389946f1a4..8f1346add322 100644 --- a/frontend/common/utils/utils.tsx +++ b/frontend/common/utils/utils.tsx @@ -227,8 +227,8 @@ const Utils = Object.assign({}, require('./base/_utils'), { flagsmithFeatureExists(flag: string) { return Object.prototype.hasOwnProperty.call(flagsmith.getAllFlags(), flag) }, - getContentType(contentTypes: ContentType[], model: string, type: string) { - return contentTypes.find((c: ContentType) => c[model] === type) || null + getContentType(contentTypes: ContentType[] | undefined, model: string, type: string) { + return contentTypes?.find((c: ContentType) => c[model] === type) || null }, getCreateProjectPermission(organisation: Organisation) { if (organisation?.restrict_project_create_to_admin) {