From b0ada585dba90ab55ab5a6064c8fad542d0791c2 Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 22 Dec 2021 17:36:51 -0500 Subject: [PATCH] Fix crash when removing a user when user.Location is null --- ProjectLighthouse/Database.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProjectLighthouse/Database.cs b/ProjectLighthouse/Database.cs index 25a9fb23..a8b5b45e 100644 --- a/ProjectLighthouse/Database.cs +++ b/ProjectLighthouse/Database.cs @@ -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);