From e09a5b5fb2bb895259e7788e8fdaf72e6af21992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leosvel=20P=C3=A9rez=20Espinosa?= Date: Wed, 12 Feb 2025 18:21:23 +0100 Subject: [PATCH] fix(core): handle nullable `lock` when creating project graph (#30000) ## Current Behavior The project graph construction can throw an error when the lock is not created: https://github.com/nrwl/nx/issues/29821#issuecomment-2653007563. ## Expected Behavior The project graph construction should correctly handle the nullable lock. ## Related Issue(s) Fixes # --- packages/nx/src/project-graph/project-graph.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nx/src/project-graph/project-graph.ts b/packages/nx/src/project-graph/project-graph.ts index 5f5e59584cc9c..ba19e31fce547 100644 --- a/packages/nx/src/project-graph/project-graph.ts +++ b/packages/nx/src/project-graph/project-graph.ts @@ -363,7 +363,7 @@ export async function createProjectGraphAndSourceMapsAsync( } catch (e) { handleProjectGraphError(opts, e); } finally { - lock.unlock(); + lock?.unlock(); } } else { try {