From 337fa875924da088fb486de60c76e6aa05dd3beb Mon Sep 17 00:00:00 2001 From: Erik van der Boom Date: Wed, 22 Jul 2026 00:13:31 +0200 Subject: [PATCH] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- mcp-ts/src/tools.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mcp-ts/src/tools.ts b/mcp-ts/src/tools.ts index c475326..cf1e1ea 100644 --- a/mcp-ts/src/tools.ts +++ b/mcp-ts/src/tools.ts @@ -1729,7 +1729,13 @@ function listStoryMarkdownFiles(root: string): string[] { } function collectMarkdownFiles(dir: string, acc: string[]): void { - for (const entry of fs.readdirSync(dir, { withFileTypes: true })) { + let entries: fs.Dirent[]; + try { + entries = fs.readdirSync(dir, { withFileTypes: true }); + } catch { + return; + } + for (const entry of entries) { const fullPath = path.join(dir, entry.name); if (entry.isDirectory()) { collectMarkdownFiles(fullPath, acc);