From bba0f5f618b69bfebaeb5bf8f0c1ef30afaab776 Mon Sep 17 00:00:00 2001 From: James Kolpack Date: Sun, 25 Jan 2026 21:59:16 -0500 Subject: [PATCH] Fix formatting issue in Team entity and improve ToString method for null safety This commit addresses a formatting issue in the Team.cs file by removing an invisible character at the beginning of the file. Additionally, the ToString method is updated to safely handle null values for the Event property, ensuring that it returns a default message when no event is associated with the team. These changes enhance code readability and prevent potential null reference exceptions. --- Core/Entities/Team.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/Entities/Team.cs b/Core/Entities/Team.cs index 3b57ede..49b2dae 100644 --- a/Core/Entities/Team.cs +++ b/Core/Entities/Team.cs @@ -1,4 +1,4 @@ -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using Core.Models; namespace Core.Entities; @@ -61,6 +61,6 @@ public class Team public override string ToString() { - return $"{Event.Name} {(Identifier != null ? $"({Identifier})" : "")}"; + return $"{Event?.Name ?? "(no event)"} {(Identifier != null ? $"({Identifier})" : "")}"; } } \ No newline at end of file