File tree Expand file tree Collapse file tree
src/vs/editor/contrib/documentSymbols Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,13 +150,13 @@ export class OutlineGroup extends TreeElement {
150150 }
151151
152152 getItemEnclosingPosition ( position : IPosition ) : OutlineElement {
153- return this . _getItemEnclosingPosition ( position , this . children ) ;
153+ return position ? this . _getItemEnclosingPosition ( position , this . children ) : undefined ;
154154 }
155155
156156 private _getItemEnclosingPosition ( position : IPosition , children : { [ id : string ] : OutlineElement } ) : OutlineElement {
157157 for ( let key in children ) {
158158 let item = children [ key ] ;
159- if ( ! Range . containsPosition ( item . symbol . range , position ) ) {
159+ if ( ! item . symbol . range || ! Range . containsPosition ( item . symbol . range , position ) ) {
160160 continue ;
161161 }
162162 return this . _getItemEnclosingPosition ( position , item . children ) || item ;
You can’t perform that action at this time.
0 commit comments