Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.

Commit ece96ce

Browse files
committed
refactor: from ContainsKey to TryGetValue in ErrorProblemDetailsJsonConverter
1 parent d6ffa41 commit ece96ce

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Serializers/ErrorProblemDetailsJsonConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ public override void Write(Utf8JsonWriter writer, ErrorProblemDetails value, Jso
147147
if(value.TraceId is null)
148148
{
149149
var propertyName = _traceId.ToString();
150-
if(value.Extensions.ContainsKey(propertyName))
150+
if(value.Extensions.TryGetValue(propertyName, out var property))
151151
{
152-
var traceId = Convert.ToString(value.Extensions[propertyName]);
152+
var traceId = Convert.ToString(property);
153153
writer.WriteString(_traceId, traceId);
154154
}
155155
}

0 commit comments

Comments
 (0)