From 7919216bbe86fed3a1d43cefee711aac92541386 Mon Sep 17 00:00:00 2001 From: David Hall Date: Sun, 5 May 2024 17:42:08 -0600 Subject: [PATCH] Added nullability to SafeHANDLE operators (#459) --- PInvoke/Shared/Handles/SafeHANDLE.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PInvoke/Shared/Handles/SafeHANDLE.cs b/PInvoke/Shared/Handles/SafeHANDLE.cs index 311b035b..a9b246ca 100644 --- a/PInvoke/Shared/Handles/SafeHANDLE.cs +++ b/PInvoke/Shared/Handles/SafeHANDLE.cs @@ -36,7 +36,7 @@ public abstract class SafeHANDLE : SafeHandleZeroOrMinusOneIsInvalid, IEquatable /// The first handle. /// The second handle. /// The result of the operator. - public static bool operator !=(SafeHANDLE h1, IHandle? h2) => !(h1 == h2); + public static bool operator !=(SafeHANDLE? h1, IHandle? h2) => !(h1 == h2); /// Implements the operator !=. /// The first handle. @@ -48,7 +48,7 @@ public abstract class SafeHANDLE : SafeHandleZeroOrMinusOneIsInvalid, IEquatable /// The first handle. /// The second handle. /// The result of the operator. - public static bool operator ==(SafeHANDLE h1, IHandle? h2) => h1?.Equals(h2) ?? h2 is null; + public static bool operator ==(SafeHANDLE? h1, IHandle? h2) => h1?.Equals(h2) ?? h2 is null; /// Implements the operator ==. /// The first handle.