From 278e1f8926e43a0e76fdb16471220cef4e3f85db Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Fri, 3 Feb 2023 09:24:48 +0100 Subject: [PATCH] fix(user-management): Fix deleting user in hidden group(s) E.g. guest_users Signed-off-by: Christoph Wurst --- apps/settings/src/store/users.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/settings/src/store/users.js b/apps/settings/src/store/users.js index ec15c8dd7452f..03e6b6b8fca03 100644 --- a/apps/settings/src/store/users.js +++ b/apps/settings/src/store/users.js @@ -184,6 +184,10 @@ const mutations = { state.userCount-- // decrement Active Users count user.groups.forEach(userGroup => { const group = state.groups.find(groupSearch => groupSearch.id === userGroup) + if (!group) { + console.warn('User group ' + userGroup + ' does not exist during user removal') + return + } group.usercount-- // decrement group total count }) } else {