Skip to content

Commit d4b4e3f

Browse files
committed
Do not use parameter null-checking' feature. It had been added as a preview to .NET for the upcoming C# 11 that was eventually postponed due to developer objections in April 2022.
See: https://github.com/dotnet/csharplang/blob/main/meetings/2022/LDM-2022-04-06.md#parameter-null-checking
1 parent 0813297 commit d4b4e3f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Source/HttpMultipartParser/StreamingMultipartFormDataParser.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,10 @@ private static async Task<string> DetectBoundaryAsync(RebufferableBinaryReader r
364364
/// </summary>
365365
/// <param name="parameters">The section parameters.</param>
366366
/// <returns>true if the section contains a file, false otherwise.</returns>
367-
private bool IsFilePart(IDictionary<string, string> parameters!!)
367+
private bool IsFilePart(IDictionary<string, string> parameters)
368368
{
369+
if (parameters == null) throw new ArgumentNullException(nameof(parameters));
370+
369371
// A section without any parameter is invalid. It is very likely to contain just a bunch of blank lines.
370372
if (parameters.Count == 0) return false;
371373

@@ -388,8 +390,10 @@ private bool IsFilePart(IDictionary<string, string> parameters!!)
388390
/// </summary>
389391
/// <param name="parameters">The section parameters.</param>
390392
/// <returns>true if the section contains a data parameter, false otherwise.</returns>
391-
private bool IsParameterPart(IDictionary<string, string> parameters!!)
393+
private bool IsParameterPart(IDictionary<string, string> parameters)
392394
{
395+
if (parameters == null) throw new ArgumentNullException(nameof(parameters));
396+
393397
// A section without any parameter is invalid. It is very likely to contain just a bunch of blank lines.
394398
if (parameters.Count == 0) return false;
395399

0 commit comments

Comments
 (0)