You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/src/NzbDrone.Common/EnsureThat/EnsureNullableValueTypeExte...

21 lines
572 B

using System.Diagnostics;
using NzbDrone.Common.EnsureThat.Resources;
namespace NzbDrone.Common.EnsureThat
{
public static class EnsureNullableValueTypeExtensions
{
[DebuggerStepThrough]
public static Param<T?> IsNotNull<T>(this Param<T?> param)
where T : struct
{
if (param.Value == null || !param.Value.HasValue)
{
throw ExceptionFactory.CreateForParamNullValidation(param.Name, ExceptionMessages.EnsureExtensions_IsNotNull);
}
return param;
}
}
}