File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1088,14 +1088,16 @@ namespace ts {
1088
1088
lastDirectoryPart = lastDirectoryPartWithDirectorySeparator . slice ( directorySeparator . length ) ;
1089
1089
}
1090
1090
/** Watcher for the file system entry depending on whether it is missing or present */
1091
- let watcher = ! fileSystemEntryExists ( fileOrDirectory , entryKind ) ?
1091
+ let watcher : FileWatcher | undefined = ! fileSystemEntryExists ( fileOrDirectory , entryKind ) ?
1092
1092
watchMissingFileSystemEntry ( ) :
1093
1093
watchPresentFileSystemEntry ( ) ;
1094
1094
return {
1095
1095
close : ( ) => {
1096
1096
// Close the watcher (either existing file system entry watcher or missing file system entry watcher)
1097
- watcher . close ( ) ;
1098
- watcher = undefined ! ;
1097
+ if ( watcher ) {
1098
+ watcher . close ( ) ;
1099
+ watcher = undefined ;
1100
+ }
1099
1101
}
1100
1102
} ;
1101
1103
You can’t perform that action at this time.
0 commit comments