diff --git a/SharedProject/Editor/DynamicCoverage/Utilities/TextInfo.cs b/SharedProject/Editor/DynamicCoverage/Utilities/TextInfo.cs index 6b1e4203..a5876363 100644 --- a/SharedProject/Editor/DynamicCoverage/Utilities/TextInfo.cs +++ b/SharedProject/Editor/DynamicCoverage/Utilities/TextInfo.cs @@ -36,7 +36,7 @@ public TextInfo(ITextView textView, ITextBuffer textBuffer) public ITextView TextView { get; } public ITextBuffer2 TextBuffer { get; } public string FilePath => this.TextDocument?.FilePath; - public string GetFileText() => File.ReadAllText(this.FilePath); + public string GetFileText() => File.Exists(this.FilePath) ? File.ReadAllText(this.FilePath) : null; public DateTime GetLastWriteTime() => new FileInfo(this.FilePath).LastWriteTime; } }