Skip to content

Commit f7d83b8

Browse files
committed
Fix null check for festivals
1 parent 5a85e66 commit f7d83b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Brio/Game/World/FestivalService.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public ReadOnlyCollection<FestivalEntry> ActiveFestivals
2626
var active = _festivalInterop.GetActiveFestivals();
2727
for(int idx = 0; idx < MaxFestivals; ++idx)
2828
{
29-
var entry = _festivalEntries.First(i => i.Id == active[idx]);
30-
if(entry.Id != 0)
29+
var entry = _festivalEntries.FirstOrDefault(i => i.Id == active[idx]);
30+
if(entry != null && entry.Id != 0)
3131
result.Add(entry);
3232
}
3333
return new(result);

0 commit comments

Comments
 (0)