From 6f05ff65e10b8eac8d676d3c69ff1bed1a5b69cd Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 26 Oct 2026 19:30:11 -0500 Subject: make wait key operators null-safe --- src/slskd/Common/WaitKey.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slskd/Common/WaitKey.cs b/src/slskd/Common/WaitKey.cs index af71af7a..3306103d 100644 --- a/src/slskd/Common/WaitKey.cs +++ b/src/slskd/Common/WaitKey.cs @@ -61,12 +61,12 @@ namespace slskd public static bool operator !=(WaitKey lhs, WaitKey rhs) { - return !lhs.Equals(rhs); + return !(lhs == rhs); } public static bool operator ==(WaitKey lhs, WaitKey rhs) { - return lhs.Equals(rhs); + return lhs is null ? rhs is null : lhs.Equals(rhs); } /// @@ -93,7 +93,7 @@ namespace slskd /// A value indicating whether the specified WaitKey is equal to this instance. public bool Equals(WaitKey other) { - return Token == other.Token; + return other is not null && Token == other.Token; } /// -- cgit v1.2.3