Skip to content

Commit 0092c82

Browse files
committed
make scopedData object nullable
1 parent 48ec429 commit 0092c82

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Mindscape.Raygun4Net.Extensions.Logging/RaygunLogger.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,14 @@ public IDisposable BeginScope<TState>(TState state)
134134
var scopeData = _scopeData.Value;
135135
if (scopeData == null)
136136
{
137-
scopeData = new Dictionary<string, object>();
137+
scopeData = new Dictionary<string, object?>();
138138
_scopeData.Value = scopeData;
139139
}
140140

141141
// Handle different types of state
142142
switch (state)
143143
{
144-
case IEnumerable<KeyValuePair<string, object>> properties:
144+
case IEnumerable<KeyValuePair<string, object?>> properties:
145145
foreach (var prop in properties)
146146
{
147147
scopeData[$"[{scopeData.Count}].{prop.Key}"] = prop.Value;
@@ -157,9 +157,9 @@ public IDisposable BeginScope<TState>(TState state)
157157

158158
private class RaygunLoggerScope : IDisposable
159159
{
160-
private readonly AsyncLocal<Dictionary<string, object>> _scopeData;
160+
private readonly AsyncLocal<Dictionary<string, object?>> _scopeData;
161161

162-
public RaygunLoggerScope(AsyncLocal<Dictionary<string, object>> scopeData)
162+
public RaygunLoggerScope(AsyncLocal<Dictionary<string, object?>> scopeData)
163163
{
164164
_scopeData = scopeData;
165165
}

0 commit comments

Comments
 (0)