From 5a84425d164e0a867b298412075b179b55ede2b9 Mon Sep 17 00:00:00 2001 From: Ruben Mesquida <16049893+mesquidar@users.noreply.github.com> Date: Thu, 7 Nov 2024 19:18:59 +0100 Subject: [PATCH] Update User GetRole Func --- Cervantes.Web/Controllers/UserController.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Cervantes.Web/Controllers/UserController.cs b/Cervantes.Web/Controllers/UserController.cs index a767262..e95a871 100644 --- a/Cervantes.Web/Controllers/UserController.cs +++ b/Cervantes.Web/Controllers/UserController.cs @@ -123,6 +123,10 @@ public async Task GetRole(string userId) var user2 = usrManager.GetByUserId(userId); var rolUser = await authUsersAdminService.FindAuthUserByUserIdAsync(user2.Id); + if (rolUser.Result == null) + { + return String.Empty; + } var test = rolUser.Result.UserRoles; if (test.Count == 0)