Răsfoiți Sursa

Merge pull request #12286 from overleaf/msm-fix-sp-react

[web] Fix Null Pointer Exception with `templateLinks` in CE/SP

GitOrigin-RevId: 3b5597e70e73bc605bece3d2f463f58c01acac8e
Miguel Serrano 3 ani în urmă
părinte
comite
aee777ca1d

+ 1 - 1
services/web/frontend/js/features/project-list/components/new-project-button.tsx

@@ -221,7 +221,7 @@ function NewProjectButton({
           ) : null}
           <MenuItem divider />
           <MenuItem header>{t('templates')}</MenuItem>
-          {templateLinks.map((templateLink, index) => (
+          {templateLinks?.map((templateLink, index) => (
             <MenuItem
               key={`new-project-button-template-${index}`}
               href={templateLink.url}

+ 1 - 1
services/web/types/exposed-settings.ts

@@ -37,6 +37,6 @@ export type ExposedSettings = {
   siteUrl: string
   textExtensions: string[]
   validRootDocExtensions: string[]
-  templateLinks: TemplateLink[]
+  templateLinks?: TemplateLink[]
   labsEnabled: boolean
 }