From 2fa426510febf0b5e0a45b0f41553479697fbf5c Mon Sep 17 00:00:00 2001 From: rgosse Date: Thu, 2 Jun 2022 17:15:51 -0400 Subject: [PATCH 1/2] UI-7417 - Handle nodes with missing content --- src/migrateUIFolder.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/migrateUIFolder.ts b/src/migrateUIFolder.ts index 4136df59..bfd42e07 100644 --- a/src/migrateUIFolder.ts +++ b/src/migrateUIFolder.ts @@ -170,7 +170,7 @@ const accumulateStructure = ({ }, }, }; - } else { + } else if (folders[id] !== undefined) { accumulateStructure({ legacyUIFolder, migratedUIFolder, @@ -180,6 +180,10 @@ const accumulateStructure = ({ folders, path: [...path, id], }); + } else { + console.error( + `The 'structure' folder contains an object of id '${id}' that could not be identified (missing or corrupted entry in 'content'). Children of that object will be ignored.` + ); } } } @@ -291,6 +295,10 @@ export function migrateUIFolder( ); } } + } else { + console.error( + `The 'content' folder contains a corrupted object of id '${id}' (no content found).` + ); } } From 6aef4f61099b2e8d24d94a5d6665b469b677a038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Goss=C3=A9?= Date: Fri, 3 Jun 2022 09:45:38 -0400 Subject: [PATCH 2/2] Update src/migrateUIFolder.ts Co-authored-by: Antoine Tissier --- src/migrateUIFolder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/migrateUIFolder.ts b/src/migrateUIFolder.ts index bfd42e07..4ab75663 100644 --- a/src/migrateUIFolder.ts +++ b/src/migrateUIFolder.ts @@ -297,7 +297,7 @@ export function migrateUIFolder( } } else { console.error( - `The 'content' folder contains a corrupted object of id '${id}' (no content found).` + `File '${id}' in the 'content' is corrupt: it has no content. Remove the file or fix its content.` ); } }