From 83f41deff29ca619dd96a5130693c10ae9e922e8 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 9 Jun 2020 11:52:39 -0700 Subject: [PATCH] Remove non null assertion on oldSourceFile.resolvedModules (#38984) Fixes #37938 --- src/compiler/program.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 18f730cafea..3678252600f 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -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);