Skip to content

Commit 9674695

Browse files
committed
Write to null stream before write to actual file.
1 parent 238b6b6 commit 9674695

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/BenchmarkDotNet.Weaver/src/WeaveAssemblyTask.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public override bool Execute()
6464

6565
if (benchmarkMethodsImplAdjusted)
6666
{
67+
// Write to a null stream before overwriting the original file in case an exception occurs during the write (like unsupported platform).
68+
// https://github.com/Washi1337/AsmResolver/issues/640
69+
module.Write(Stream.Null);
6770
module.Write(TargetAssembly);
6871
}
6972
}

0 commit comments

Comments
 (0)