提交 019ce0eb 编写于 作者: B Benjamin Pasero

fix #18160

上级 c43059c0
......@@ -76,7 +76,7 @@ export class DefinitionAction extends EditorAction {
let result: Location[] = [];
for (let i = 0; i < references.length; i++) {
let reference = references[i];
if (!reference) {
if (!reference || !reference.range) {
continue;
}
let {uri, range} = reference;
......@@ -110,7 +110,7 @@ export class DefinitionAction extends EditorAction {
} else {
let next = model.nearestReference(editor.getModel().uri, editor.getPosition());
this._openReference(editorService, next, this._configuration.openToSide).then(editor => {
if (model.references.length > 1) {
if (editor && model.references.length > 1) {
this._openInPeek(editorService, editor, model);
} else {
model.dispose();
......@@ -128,7 +128,7 @@ export class DefinitionAction extends EditorAction {
revealIfVisible: !sideBySide
}
}, sideBySide).then(editor => {
return <editorCommon.IEditor>editor.getControl();
return editor && <editorCommon.IEditor>editor.getControl();
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册