Skip to content

Commit 7a0a83e

Browse files
committed
fix: added validation
1 parent 38d061d commit 7a0a83e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

upload-api/migration-contentful/libs/extractContentTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const saveContentType = (contentTypes, editorInterface, prefix) => {
7070
path.join(
7171
contentfulFolderPath,
7272
`${
73-
(content.name.charAt(0).toUpperCase() + content.name.slice(1)).replace(/[^\w\s]/g, "")
73+
(content?.name?.charAt(0)?.toUpperCase() + content?.name?.slice(1))?.replace(/[^\w\s]/g, "")
7474
}.json`
7575
),
7676
JSON.stringify(jsonObj, null, 4)

0 commit comments

Comments
 (0)