diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-10-26 19:30:11 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-10-26 19:30:11 -0500 |
| commit | 6f05ff65e10b8eac8d676d3c69ff1bed1a5b69cd (patch) | |
| tree | 01aae9016299a6b8caba2fcad9702e3f74271f12 /src/slskd | |
| parent | 8fbaea0807a4eabc11d350832ccb4ac8e7ed6656 (diff) | |
| download | slskd-6f05ff65e10b8eac8d676d3c69ff1bed1a5b69cd.tar.gz | |
make wait key operators null-safe
Diffstat (limited to 'src/slskd')
| -rw-r--r-- | src/slskd/Common/WaitKey.cs | 6 |
1 files 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); } /// <summary> @@ -93,7 +93,7 @@ namespace slskd /// <returns>A value indicating whether the specified WaitKey is equal to this instance.</returns> public bool Equals(WaitKey other) { - return Token == other.Token; + return other is not null && Token == other.Token; } /// <summary> |
