File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -3573,14 +3573,16 @@ module ts {
35733573
35743574 function getOccurrencesAtPosition ( fileName : string , position : number ) : ReferenceEntry [ ] {
35753575 let results = getOccurrencesAtPositionCore ( fileName , position ) ;
3576-
3577- let sourceFile = getCanonicalFileName ( normalizeSlashes ( fileName ) ) ;
3578-
3579- // ensure the results are in the file we're interested in
3580- results . forEach ( ( value ) => {
3581- let targetFile = getCanonicalFileName ( normalizeSlashes ( value . fileName ) ) ;
3582- Debug . assert ( sourceFile == targetFile , `Unexpected file in results. Found results in ${ targetFile } expected only results in ${ sourceFile } .` ) ;
3583- } ) ;
3576+
3577+ if ( results ) {
3578+ let sourceFile = getCanonicalFileName ( normalizeSlashes ( fileName ) ) ;
3579+
3580+ // ensure the results are in the file we're interested in
3581+ results . forEach ( ( value ) => {
3582+ let targetFile = getCanonicalFileName ( normalizeSlashes ( value . fileName ) ) ;
3583+ Debug . assert ( sourceFile == targetFile , `Unexpected file in results. Found results in ${ targetFile } expected only results in ${ sourceFile } .` ) ;
3584+ } ) ;
3585+ }
35843586
35853587 return results ;
35863588 }
You can’t perform that action at this time.
0 commit comments