Remove non null assertion on oldSourceFile.resolvedModules (#38984)

Fixes #37938
This commit is contained in:
Sheetal Nandi 2020-06-09 11:52:39 -07:00 committed by GitHub
parent d841971347
commit 83f41deff2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1110,7 +1110,7 @@ namespace ts {
const moduleName = moduleNames[i];
// If the source file is unchanged and doesnt have invalidated resolution, reuse the module resolutions
if (file === oldSourceFile && !hasInvalidatedResolution(oldSourceFile.path)) {
const oldResolvedModule = oldSourceFile && oldSourceFile.resolvedModules!.get(moduleName);
const oldResolvedModule = getResolvedModule(oldSourceFile, moduleName);
if (oldResolvedModule) {
if (isTraceEnabled(options, host)) {
trace(host, Diagnostics.Reusing_resolution_of_module_0_to_file_1_from_old_program, moduleName, containingFile);