diff --git a/packages/nx/src/daemon/server/project-graph-incremental-recomputation.ts b/packages/nx/src/daemon/server/project-graph-incremental-recomputation.ts index 2025ef3029329..0d9adaf80c0a2 100644 --- a/packages/nx/src/daemon/server/project-graph-incremental-recomputation.ts +++ b/packages/nx/src/daemon/server/project-graph-incremental-recomputation.ts @@ -228,8 +228,8 @@ function copyFileMap(m: ProjectFileMap) { return c; } -function copyProjectGraph(p: ProjectGraph): ProjectGraph { - return { ...p }; +function copyProjectGraph(p: ProjectGraph | null): ProjectGraph | null { + return p ? { ...p } : null; } async function createAndSerializeProjectGraph(): Promise<{