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 {
52
52
getGlobalCache ?( ) : string | undefined ;
53
53
writeLog ( s : string ) : void ;
54
54
maxNumberOfFilesToIterateForInvalidation ?: number ;
55
- getCurrentProgram ( ) : Program ;
55
+ getCurrentProgram ( ) : Program | undefined ;
56
56
}
57
57
58
58
interface DirectoryWatchesOfFailedLookup {
@@ -497,7 +497,8 @@ namespace ts {
497
497
}
498
498
499
499
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 ) ?
501
502
setRefCountToUndefined : watchFailedLookupLocationOfResolution ;
502
503
resolutions . forEach ( updateResolution ) ;
503
504
}
You can’t perform that action at this time.
0 commit comments