diff --git a/utilities/project-factory/src/server/utils/generateUtils.ts b/utilities/project-factory/src/server/utils/generateUtils.ts index 430ea5963d4..e6b7ee59e40 100644 --- a/utilities/project-factory/src/server/utils/generateUtils.ts +++ b/utilities/project-factory/src/server/utils/generateUtils.ts @@ -14,6 +14,7 @@ function extractProperties(obj: any) { } function areBoundariesSame(existingBoundaries: any, currentBoundaries: any) { + if (!existingBoundaries || !currentBoundaries) return false; if (existingBoundaries.length !== currentBoundaries.length) return false; const existingSetOfBoundaries = new Set(existingBoundaries.map((exboundary: any) => JSON.stringify(extractProperties(exboundary)))); const currentSetOfBoundaries = new Set(currentBoundaries.map((currboundary: any) => JSON.stringify(extractProperties(currboundary)))); @@ -81,4 +82,4 @@ async function callGenerate(request: any, type: any) { -export { callGenerateIfBoundariesDiffer, callGenerate } \ No newline at end of file +export { callGenerateIfBoundariesDiffer, callGenerate }