Skip to content

Commit e20ee91

Browse files
authored
Fix comments when they have a permalink to a file that doesn't exist locally (#6026)
* Fix resolve conflicts button in focus view Fixes #5942 * Fix comments when they have a permalink to a file that doesn't exist locally Fixes #6025 * Revert "Fix resolve conflicts button in focus view" This reverts commit b589aa4.
1 parent f9423bd commit e20ee91

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/github/prComment.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,13 @@ ${args[3] ?? ''}
320320

321321
private async createLocalFilePath(rootUri: vscode.Uri, fileSubPath: string, startLine: number, endLine: number): Promise<string | undefined> {
322322
const localFile = vscode.Uri.joinPath(rootUri, fileSubPath);
323-
const stat = await vscode.workspace.fs.stat(localFile);
324-
if (stat.type === vscode.FileType.File) {
325-
return `${localFile.with({ fragment: `${startLine}-${endLine}` }).toString()}`;
323+
try {
324+
const stat = await vscode.workspace.fs.stat(localFile);
325+
if (stat.type === vscode.FileType.File) {
326+
return `${localFile.with({ fragment: `${startLine}-${endLine}` }).toString()}`;
327+
}
328+
} catch (e) {
329+
return undefined;
326330
}
327331
}
328332

0 commit comments

Comments
 (0)