diff --git a/WebApp/Components/Features/Calendar/Import.razor b/WebApp/Components/Features/Calendar/Import.razor index 569b508..9163457 100644 --- a/WebApp/Components/Features/Calendar/Import.razor +++ b/WebApp/Components/Features/Calendar/Import.razor @@ -155,6 +155,7 @@ .SelectMany(list => list) .Select(eo => eo.Location) .Where(loc => !string.IsNullOrWhiteSpace(loc)) + .Cast() // Cast to non-nullable string after null check .Distinct() .OrderBy(loc => loc) .ToList(); diff --git a/WebApp/Components/Features/Calendar/Index.razor b/WebApp/Components/Features/Calendar/Index.razor index 32882d6..3d593ba 100644 --- a/WebApp/Components/Features/Calendar/Index.razor +++ b/WebApp/Components/Features/Calendar/Index.razor @@ -110,7 +110,9 @@ } // Get student first names for this event definition - var studentFirstNames = StudentFirstNames(occ.EventDefinition, teamsByEventId); + var studentFirstNames = occ.EventDefinition != null + ? StudentFirstNames(occ.EventDefinition, teamsByEventId) + : new List(); var calendarItem = new CalendarEventItem(occ, studentFirstNames); items.Add(calendarItem);