Skip to content

Commit

Permalink
Merge pull request #1045 from gordon-cs/fix-events-loading
Browse files Browse the repository at this point in the history
Use empty enumerable when events aren't loaded
  • Loading branch information
EjPlatzer authored May 30, 2024
2 parents 43eecc2 + e31b95f commit 8be09eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Gordon360/Services/EventService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class EventService(CCTContext context, IMemoryCache cache, IAccountServic
*/
private static readonly string AllEventsURL = "https://25live.collegenet.com/25live/data/gordon/run/events.xml?/&event_type_id=14+57&state=2&end_after=" + GetFirstEventDate() + "&scope=extended";

private IEnumerable<EventViewModel> Events => cache.Get<IEnumerable<EventViewModel>>(CacheKeys.Events);
private IEnumerable<EventViewModel> Events => cache.Get<IEnumerable<EventViewModel>>(CacheKeys.Events) ?? [];

/// <summary>
/// Access the memory stream created by the cached task and parse it into events
Expand Down

0 comments on commit 8be09eb

Please sign in to comment.