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

(#42) Validate not-null value

This commit is contained in:
Oliver Booth 2021-06-27 13:14:11 +01:00
parent e3d38a633d
commit 370f2d96f4

View File

@ -46,6 +46,11 @@ namespace X10D
public static bool Between<T1, T2, T3>(this T1 value, T2 lower, T3 upper) public static bool Between<T1, T2, T3>(this T1 value, T2 lower, T3 upper)
where T1 : IComparable<T2>, IComparable<T3> where T1 : IComparable<T2>, IComparable<T3>
{ {
if (value is null)
{
throw new ArgumentNullException(nameof(value));
}
return value.CompareTo(lower) > 0 && value.CompareTo(upper) < 0; return value.CompareTo(lower) > 0 && value.CompareTo(upper) < 0;
} }