1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-10 04:55:42 +00:00

Add argument null check (#42)

This commit is contained in:
Oliver Booth 2022-04-30 10:35:21 +01:00
parent 2547d4a227
commit e757ce08a0
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634

View File

@ -1,4 +1,4 @@
using System.Diagnostics.Contracts;
using System.Diagnostics.Contracts;
using System.Web;
namespace X10D.Collections;
@ -226,6 +226,11 @@ public static class DictionaryExtensions
throw new ArgumentNullException(nameof(source));
}
if (selector is null)
{
throw new ArgumentNullException(nameof(selector));
}
static string SanitizeValue(string? value)
{
if (value is null)
@ -268,6 +273,16 @@ public static class DictionaryExtensions
throw new ArgumentNullException(nameof(source));
}
if (keySelector is null)
{
throw new ArgumentNullException(nameof(keySelector));
}
if (valueSelector is null)
{
throw new ArgumentNullException(nameof(valueSelector));
}
static string SanitizeValue(string? value)
{
if (value is null)
@ -371,6 +386,11 @@ public static class DictionaryExtensions
throw new ArgumentNullException(nameof(source));
}
if (keySelector is null)
{
throw new ArgumentNullException(nameof(keySelector));
}
if (valueSelector is null)
{
throw new ArgumentNullException(nameof(valueSelector));