Skip to content

Commit 369778f

Browse files
committed
TryGetValue
1 parent f745c69 commit 369778f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

WebApiClient/Internal/RequestHeader.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ from header in Enum.GetValues(typeof(HttpRequestHeader)).Cast<HttpRequestHeader>
4242
/// <returns></returns>
4343
public static string GetName(HttpRequestHeader header)
4444
{
45-
return cache[header];
45+
cache.TryGetValue(header, out string name);
46+
return name;
4647
}
4748
}
4849
}

0 commit comments

Comments
 (0)