aboutsummaryrefslogtreecommitdiff
path: root/lib/Utils/src/Resources
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-01-13 22:42:13 -0500
committerLibravatar vnugent <public@vaughnnugent.com>2024-01-13 22:42:13 -0500
commit299c41bf07d22daf7a6707bf2d485193c0ef61b8 (patch)
treec77740a12e74689ed637bf177c3cc78aa0672e92 /lib/Utils/src/Resources
parentddead3ab60254fcc1c8029715e094480da51dcd0 (diff)
using new exception api
Diffstat (limited to 'lib/Utils/src/Resources')
-rw-r--r--lib/Utils/src/Resources/ManagedLibrary.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Utils/src/Resources/ManagedLibrary.cs b/lib/Utils/src/Resources/ManagedLibrary.cs
index 56835c7..786a22d 100644
--- a/lib/Utils/src/Resources/ManagedLibrary.cs
+++ b/lib/Utils/src/Resources/ManagedLibrary.cs
@@ -189,7 +189,7 @@ namespace VNLib.Utils.Resources
/// <exception cref="FileNotFoundException"></exception>
public static ManagedLibrary LoadManagedAssembly(string assemblyName, AssemblyLoadContext loadContext)
{
- _ = loadContext ?? throw new ArgumentNullException(nameof(loadContext));
+ ArgumentNullException.ThrowIfNull(loadContext);
//Make sure the file exists
if (!FileOperations.FileExists(assemblyName))
@@ -218,8 +218,8 @@ namespace VNLib.Utils.Resources
BindingFlags flags = BindingFlags.Public
) where TDelegate : Delegate
{
- _ = obj ?? throw new ArgumentNullException(nameof(obj));
- return TryGetMethodInternal<TDelegate>(obj.GetType(), methodName, obj, flags | BindingFlags.Instance);
+ ArgumentNullException.ThrowIfNull(obj);
+ return TryGetMethodInternal<TDelegate>(obj.GetType(), methodName, obj, flags | BindingFlags.Instance);
}
/// <summary>
@@ -271,7 +271,7 @@ namespace VNLib.Utils.Resources
private static TDelegate? TryGetMethodInternal<TDelegate>(Type type, string methodName, object? target, BindingFlags flags) where TDelegate : Delegate
{
- _ = type ?? throw new ArgumentNullException(nameof(type));
+ ArgumentNullException.ThrowIfNull(type);
//Get delegate argument types incase of a method overload
Type[] delegateArgs = typeof(TDelegate).GetMethod("Invoke")!