Skip to content

Commit 4be5365

Browse files
authored
Merge pull request #375 from tonerdo/fix-embeddedpdb-backups
Fix Backup Symbol File Restore for Embedded PDBs
2 parents 10e9a62 + 014bb61 commit 4be5365

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/coverlet.core/Helpers/InstrumentationHelper.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,11 @@ public static void RestoreOriginalModule(string module, string identifier)
109109

110110
RetryHelper.Retry(() =>
111111
{
112-
File.Copy(backupSymbolPath, Path.ChangeExtension(module, ".pdb"), true);
113-
File.Delete(backupSymbolPath);
112+
if (File.Exists(backupSymbolPath))
113+
{
114+
File.Copy(backupSymbolPath, Path.ChangeExtension(module, ".pdb"), true);
115+
File.Delete(backupSymbolPath);
116+
}
114117
}, retryStrategy, 10);
115118
}
116119

0 commit comments

Comments
 (0)