Skip to content

Commit

Permalink
Added null handlers to SafeHANDLE equality methods. (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
dahall committed Apr 27, 2024
1 parent a5d7e2b commit dc62d8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PInvoke/Shared/Handles/SafeHANDLE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public SafeHANDLE() : base(true)
/// <param name="h1">The first handle.</param>
/// <param name="h2">The second handle.</param>
/// <returns>The result of the operator.</returns>
public static bool operator !=(SafeHANDLE h1, IHandle h2) => !(h1 == h2);
public static bool operator !=(SafeHANDLE h1, IHandle? h2) => !(h1 == h2);

/// <summary>Implements the operator !=.</summary>
/// <param name="h1">The first handle.</param>
Expand All @@ -48,7 +48,7 @@ public SafeHANDLE() : base(true)
/// <param name="h1">The first handle.</param>
/// <param name="h2">The second handle.</param>
/// <returns>The result of the operator.</returns>
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;

/// <summary>Implements the operator ==.</summary>
/// <param name="h1">The first handle.</param>
Expand Down

0 comments on commit dc62d8c

Please sign in to comment.