Skip to content

Commit

Permalink
add null check to Week == operator
Browse files Browse the repository at this point in the history
  • Loading branch information
trulshj committed Jan 7, 2025
1 parent 39b4eee commit 2458260
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/Core/Weeks/Week.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ private bool DateIsInWeek(DateOnly day)

public static bool operator ==(Week left, Week right)
{
if (ReferenceEquals(left, right)) return true;
if (ReferenceEquals(left, null)) return false;
if (ReferenceEquals(right, null)) return false;
return left.Year == right.Year && left.WeekNumber == right.WeekNumber;
}

Expand Down

0 comments on commit 2458260

Please sign in to comment.