提交 796f945a 编写于 作者: D Daniel Imms

Add null check to terminal link handler

Fixes #27247
上级 f479fcd2
......@@ -226,12 +226,15 @@ export class TerminalLinkHandler {
private _resolvePath(link: string): TPromise<string> {
link = this._preprocessPath(link);
if (!link) {
return TPromise.as(void 0);
}
const linkUrl = this.extractLinkUrl(link);
if (!linkUrl) {
return TPromise.as(void 0);
}
// Open an editor if the path exists
return pfs.fileExists(linkUrl).then(isFile => {
if (!isFile) {
......@@ -292,6 +295,9 @@ export class TerminalLinkHandler {
*/
public extractLinkUrl(link: string): string {
const matches: string[] = this._localLinkRegex.exec(link);
if (!matches) {
return null;
}
return matches[1];
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册