1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Common/EnsureThat/EnsureNullableValueTypeExtensions.cs

17 lines
531 B
C#
Raw Normal View History

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;
}
}
}