Skip to content

Commit 8ab46bf

Browse files
committed
Get null return value from ExecutionContext caused an exception
1 parent 21ceb1b commit 8ab46bf

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7-
## v3.0.1
7+
## v3.0.2
88
### Fixed
99
- Get null return value from ExecutionContext caused an exception
1010

src/MeasureMap/ProfilerResult.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace MeasureMap
1111
/// </summary>
1212
public class ProfilerResult : IProfilerResult
1313
{
14-
private readonly List<IResult> _results = new List<IResult>();
14+
private readonly List<IResult> _results = new();
1515

1616
/// <summary>
1717
/// Creates a profiler result
@@ -130,6 +130,11 @@ public TimeSpan TotalTime
130130
/// <param name="result"></param>
131131
public void Add(IResult result)
132132
{
133+
if (result == null)
134+
{
135+
return;
136+
}
137+
133138
_results.Add(result);
134139
Last = result;
135140
}

0 commit comments

Comments
 (0)