Skip to content

Commit 93936f1

Browse files
committed
fix(settings): Only increment usercount if group can be found
Signed-off-by: Christopher Ng <chrng8@gmail.com>
1 parent cf75a55 commit 93936f1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

apps/settings/src/store/users.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,11 @@ const mutations = {
167167
state.userCount++ // increment Active Users count
168168

169169
user.groups.forEach(userGroup => {
170-
state.groups
171-
.find(groupSearch => groupSearch.id === userGroup)
172-
.usercount++ // increment group total count
170+
const group = state.groups.find(groupSearch => groupSearch.id === userGroup)
171+
if (!group) {
172+
return
173+
}
174+
group.usercount++ // increment group total count
173175
})
174176
break
175177
case 'remove':

0 commit comments

Comments
 (0)