From 4f1d4276a01a079806f36f05180c61ca587f86a4 Mon Sep 17 00:00:00 2001 From: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Date: Mon, 20 Apr 2020 17:18:38 -0700 Subject: [PATCH] Check for file scheme in linkhandler (#10090) --- .../browser/cellViews/linkHandler.directive.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/sql/workbench/contrib/notebook/browser/cellViews/linkHandler.directive.ts b/src/sql/workbench/contrib/notebook/browser/cellViews/linkHandler.directive.ts index 1825be105a..25c20166d5 100644 --- a/src/sql/workbench/contrib/notebook/browser/cellViews/linkHandler.directive.ts +++ b/src/sql/workbench/contrib/notebook/browser/cellViews/linkHandler.directive.ts @@ -65,14 +65,16 @@ export class LinkHandlerDirective { if (uri.fragment && uri.fragment.length > 0 && uri.fsPath === this.workbenchFilePath.fsPath) { this.notebookService.navigateTo(this.notebookUri, uri.fragment); } else { - let exists = await this.fileService.exists(uri); - if (!exists) { - let relPath = relative(this.workbenchFilePath.fsPath, uri.fsPath); - let path = resolve(this.notebookUri.fsPath, relPath); - try { - uri = URI.file(path); - } catch (error) { - onUnexpectedError(error); + if (uri.scheme === 'file') { + let exists = await this.fileService.exists(uri); + if (!exists) { + let relPath = relative(this.workbenchFilePath.fsPath, uri.fsPath); + let path = resolve(this.notebookUri.fsPath, relPath); + try { + uri = URI.file(path); + } catch (error) { + onUnexpectedError(error); + } } } if (this.forceOpenExternal(uri)) {