fixed crash if user exists but has no account

This commit is contained in:
Sarah Faey 2022-12-01 21:12:23 +01:00
parent 1c0bce5c4e
commit ce405a3e36

View file

@ -164,7 +164,10 @@ namespace Lieb.Controllers
{ {
AccountName = user.AccountName AccountName = user.AccountName
}; };
await _userService.CreateUser(user.UserId, user.UserName); if(_userService.GetLiebUserGW2AccountOnly(user.UserId) == null)
{
await _userService.CreateUser(user.UserId, user.UserName);
}
await _gw2AccountService.AddOrEditAccount(gw2Account, user.UserId); await _gw2AccountService.AddOrEditAccount(gw2Account, user.UserId);
return Ok(); return Ok();
} }