<PackageReference Include="SSH.NET" Version="2024.2.0" />

ThrowHelper

static class ThrowHelper
using System; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace Renci.SshNet.Common { [NullableContext(2)] [Nullable(0)] internal static class ThrowHelper { [NullableContext(1)] public static void ThrowObjectDisposedIf(bool condition, object instance) { ObjectDisposedException.ThrowIf(condition, instance); } public static void ThrowIfNull([NotNull] object argument, [CallerArgumentExpression("argument")] string paramName = null) { ArgumentNullException.ThrowIfNull(argument, paramName); } public static void ThrowIfNullOrWhiteSpace([NotNull] string argument, [CallerArgumentExpression("argument")] string paramName = null) { ArgumentException.ThrowIfNullOrWhiteSpace(argument, paramName); } public static void ThrowIfNullOrEmpty([NotNull] string argument, [CallerArgumentExpression("argument")] string paramName = null) { ArgumentException.ThrowIfNullOrEmpty(argument, paramName); } } }