Skip to content

Commit d07f377

Browse files
Check for 'null' arguments in HttpContextServerVariableExtensions.GetServerVariable (#47828)
1 parent b4811e3 commit d07f377

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Http/Http.Extensions/src/HttpContextServerVariableExtensions.cs

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ public static class HttpContextServerVariableExtensions
2121
/// </returns>
2222
public static string? GetServerVariable(this HttpContext context, string variableName)
2323
{
24+
ArgumentNullException.ThrowIfNull(context);
25+
ArgumentNullException.ThrowIfNull(variableName);
26+
2427
var feature = context.Features.Get<IServerVariablesFeature>();
2528

2629
if (feature == null)

0 commit comments

Comments
 (0)