File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -480,21 +480,21 @@ namespace ts {
480480 case SyntaxKind . LetKeyword :
481481 case SyntaxKind . ConstKeyword :
482482 // if the current token is var, let or const, skip the VariableDeclarationList
483- node = node . parent . parent ;
483+ node = node . parent === undefined ? undefined : node . parent . parent ;
484484 break ;
485485 default :
486486 node = node . parent ;
487487 break ;
488488 }
489- if ( ! node . jsDocComment ) {
490- node = node . parent ;
491- }
492489 }
493- let jsDocComment = node . jsDocComment ;
494- if ( jsDocComment ) {
495- for ( let tag of jsDocComment . tags ) {
496- if ( tag . pos <= position && position <= tag . end ) {
497- return tag ;
490+
491+ if ( node ) {
492+ let jsDocComment = node . jsDocComment ;
493+ if ( jsDocComment ) {
494+ for ( let tag of jsDocComment . tags ) {
495+ if ( tag . pos <= position && position <= tag . end ) {
496+ return tag ;
497+ }
498498 }
499499 }
500500 }
You can’t perform that action at this time.
0 commit comments