Fix crash when removing a user when user.Location is null

This commit is contained in:
jvyden 2021-12-22 17:36:51 -05:00
commit b0ada585db
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278

View file

@ -259,7 +259,7 @@ namespace LBPUnion.ProjectLighthouse
public async Task RemoveUser(User user)
{
this.Locations.Remove(user.Location);
if (user.Location != null) this.Locations.Remove(user.Location);
LastContact? lastContact = await this.LastContacts.FirstOrDefaultAsync(l => l.UserId == user.UserId);
if (lastContact != null) this.LastContacts.Remove(lastContact);