Skip to content

Commit 2b0009c

Browse files
TypeScript Botsheetalkamat
TypeScript Bot
andauthored
🤖 Pick PR #58846 (Ensure the updates with crashes rev...) into release-5.5 (#58847)
Co-authored-by: Sheetal Nandi <[email protected]>
1 parent a20c69e commit 2b0009c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: ‎src/server/project.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -2245,8 +2245,12 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
22452245

22462246
this.getScriptInfo(rootFile)?.editContent(0, originalText.length, updatedText);
22472247
this.updateGraph();
2248-
cb(this.program!, originalProgram, (this.program?.getSourceFile(rootFile))!);
2249-
this.getScriptInfo(rootFile)?.editContent(0, this.program!.getSourceFile(rootFile)!.getText().length, originalText);
2248+
try {
2249+
cb(this.program!, originalProgram, (this.program?.getSourceFile(rootFile))!);
2250+
}
2251+
finally {
2252+
this.getScriptInfo(rootFile)?.editContent(0, this.program!.getSourceFile(rootFile)!.getText().length, originalText);
2253+
}
22502254
}
22512255

22522256
/** @internal */

0 commit comments

Comments
 (0)