From ce405a3e36a62c2bc90fdc93ce2b07351704c5c3 Mon Sep 17 00:00:00 2001 From: Sarah Faey Date: Thu, 1 Dec 2022 21:12:23 +0100 Subject: [PATCH] fixed crash if user exists but has no account --- Lieb/Controllers/DiscordBotController.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lieb/Controllers/DiscordBotController.cs b/Lieb/Controllers/DiscordBotController.cs index 2735983..c7ebb8c 100644 --- a/Lieb/Controllers/DiscordBotController.cs +++ b/Lieb/Controllers/DiscordBotController.cs @@ -164,7 +164,10 @@ namespace Lieb.Controllers { 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); return Ok(); }