File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ namespace ts {
5252 getGlobalCache ?( ) : string | undefined ;
5353 writeLog ( s : string ) : void ;
5454 maxNumberOfFilesToIterateForInvalidation ?: number ;
55- getCurrentProgram ( ) : Program ;
55+ getCurrentProgram ( ) : Program | undefined ;
5656 }
5757
5858 interface DirectoryWatchesOfFailedLookup {
@@ -497,7 +497,8 @@ namespace ts {
497497 }
498498
499499 function watchFailedLookupLocationOfNonRelativeModuleResolutions ( resolutions : ResolutionWithFailedLookupLocations [ ] , name : string ) {
500- const updateResolution = resolutionHost . getCurrentProgram ( ) . getTypeChecker ( ) . tryFindAmbientModuleWithoutAugmentations ( name ) ?
500+ const program = resolutionHost . getCurrentProgram ( ) ;
501+ const updateResolution = program && program . getTypeChecker ( ) . tryFindAmbientModuleWithoutAugmentations ( name ) ?
501502 setRefCountToUndefined : watchFailedLookupLocationOfResolution ;
502503 resolutions . forEach ( updateResolution ) ;
503504 }
You can’t perform that action at this time.
0 commit comments