From a539a5bbbb72fdbe3a29c8ef52f881ab791f266c Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Fri, 19 Dec 2025 22:51:06 -0800 Subject: [PATCH] fix(graph,npm): fix nil pointer crash and Windows installer lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - graph.go: Pass subgraph to renderGraph() instead of nil (fixes #657) The nil subgraph was dereferenced in computeDependencyCounts() causing a panic when running `bd graph` on epics. - postinstall.js: Wait for file.close() callback before resolving (fixes #652) On Windows, the file was still locked when extraction started because resolve() was called immediately after file.close() without waiting for the close to complete. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- cmd/bd/graph.go | 2 +- npm-package/scripts/postinstall.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/bd/graph.go b/cmd/bd/graph.go index 53e54789..cc69d4d7 100644 --- a/cmd/bd/graph.go +++ b/cmd/bd/graph.go @@ -99,7 +99,7 @@ Colors indicate status: } // Render ASCII graph - renderGraph(layout, nil) + renderGraph(layout, subgraph) }, } diff --git a/npm-package/scripts/postinstall.js b/npm-package/scripts/postinstall.js index fd6951f6..7e24059e 100755 --- a/npm-package/scripts/postinstall.js +++ b/npm-package/scripts/postinstall.js @@ -73,8 +73,12 @@ function downloadFile(url, dest) { response.pipe(file); file.on('finish', () => { - file.close(); - resolve(); + // Wait for file.close() to complete before resolving + // This is critical on Windows where the file may still be locked + file.close((err) => { + if (err) reject(err); + else resolve(); + }); }); });