fix(cli): don't crash when an @-mention captures a non-path blob (#25980)

This commit is contained in:
ifitisit
2026-05-13 16:43:08 -05:00
committed by GitHub
parent 724981baf8
commit 1814c7f358
2 changed files with 65 additions and 3 deletions
@@ -188,9 +188,15 @@ export async function checkPermissions(
const pathName = part.content.substring(1);
if (!pathName) continue;
const resolvedPathName = resolveToRealPath(
path.resolve(config.getTargetDir(), pathName),
);
let resolvedPathName: string;
try {
resolvedPathName = resolveToRealPath(
path.resolve(config.getTargetDir(), pathName),
);
} catch {
// skip if resolveToRealPath errors out
continue;
}
if (config.validatePathAccess(resolvedPathName, 'read')) {
if (await fileExists(resolvedPathName)) {