be aware that 'asAbsolutePath' might be 'null', fixes #8793

This commit is contained in:
Johannes Rieken 2016-07-13 12:59:18 +02:00
parent 82136bd865
commit ed9e56b261

View file

@ -55,16 +55,15 @@ export function create(client: ITypescriptServiceClient, isOpen:(path:string)=>P
}));
function onEditor(editor: vscode.TextEditor): void {
if (!editor || !vscode.languages.match(selector, editor.document)) {
if (!editor
|| !vscode.languages.match(selector, editor.document)
|| !client.asAbsolutePath(editor.document.uri)) {
item.hide();
return;
}
const file = client.asAbsolutePath(editor.document.uri);
if (!file) {
return;
}
isOpen(file).then(value => {
if (!value) {
return;