fixed a crash if a Template reminder would be sent
This commit is contained in:
parent
bb5926d062
commit
e2248c5156
1 changed files with 15 additions and 12 deletions
|
@ -601,10 +601,12 @@ namespace Lieb.Data
|
|||
DateTimeOffset utcNow = DateTimeOffset.UtcNow;
|
||||
foreach(RaidReminder reminder in reminders.Where(r => r.ReminderTimeUTC < utcNow))
|
||||
{
|
||||
Raid raid = context.Raids
|
||||
Raid? raid = context.Raids
|
||||
.Include(r => r.SignUps)
|
||||
.Include(r => r.Reminders)
|
||||
.First(r => r.Reminders.Where(re => re.RaidReminderId == reminder.RaidReminderId).Any());
|
||||
.FirstOrDefault(r => r.Reminders.Where(re => re.RaidReminderId == reminder.RaidReminderId).Any());
|
||||
if (raid != null)
|
||||
{
|
||||
switch (reminder.Type)
|
||||
{
|
||||
case RaidReminder.ReminderType.User:
|
||||
|
@ -619,6 +621,7 @@ namespace Lieb.Data
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public RaidRole CreateRandomSignUpRole(RaidType raidType, int spots = 10)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue