Skip to content

Commit c9e7b8f

Browse files
fixes error on first load of a new user (#47)
1 parent c4aa611 commit c9e7b8f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Player.Api/Services/UserClaimsService.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,22 @@ private async Task<UserEntity> ValidateUser(Guid subClaim, string nameClaim, boo
150150
};
151151

152152
_context.Users.Add(user);
153-
await _context.SaveChangesAsync();
154153
}
155154
else
156155
{
157156
if (nameClaim != null && user.Name != nameClaim)
158157
{
159158
user.Name = nameClaim;
160159
_context.Update(user);
161-
await _context.SaveChangesAsync();
162160
}
163161
}
162+
163+
try
164+
{
165+
await _context.SaveChangesAsync();
166+
}
167+
catch (Exception)
168+
{ }
164169
}
165170

166171
return user;

0 commit comments

Comments
 (0)