mirror of
https://github.com/Readarr/Readarr.git
synced 2026-03-29 18:14:28 -04:00
17 lines
531 B
C#
17 lines
531 B
C#
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;
|
|
}
|
|
}
|
|
} |