提交 015deacd 编写于 作者: J Johannes Rieken

fix #59274

上级 fb50addb
......@@ -150,13 +150,13 @@ export class OutlineGroup extends TreeElement {
}
getItemEnclosingPosition(position: IPosition): OutlineElement {
return this._getItemEnclosingPosition(position, this.children);
return position ? this._getItemEnclosingPosition(position, this.children) : undefined;
}
private _getItemEnclosingPosition(position: IPosition, children: { [id: string]: OutlineElement }): OutlineElement {
for (let key in children) {
let item = children[key];
if (!Range.containsPosition(item.symbol.range, position)) {
if (!item.symbol.range || !Range.containsPosition(item.symbol.range, position)) {
continue;
}
return this._getItemEnclosingPosition(position, item.children) || item;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册