Skip to content

Commit ef02bf0

Browse files
committed
Merge pull request #5628 from Microsoft/checkOnMissingFile
added missing check if file is specified
2 parents f8489af + 4720c35 commit ef02bf0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/services/services.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2847,8 +2847,11 @@ namespace ts {
28472847
}
28482848

28492849
function sourceFileUpToDate(sourceFile: SourceFile): boolean {
2850+
if (!sourceFile) {
2851+
return false;
2852+
}
28502853
let path = sourceFile.path || toPath(sourceFile.fileName, currentDirectory, getCanonicalFileName);
2851-
return sourceFile && sourceFile.version === hostCache.getVersion(path);
2854+
return sourceFile.version === hostCache.getVersion(path);
28522855
}
28532856

28542857
function programUpToDate(): boolean {

0 commit comments

Comments
 (0)