diff --git a/client/coral-admin/src/components/CommentLabels.js b/client/coral-admin/src/components/CommentLabels.js index 630f0c02d..bff4f575a 100644 --- a/client/coral-admin/src/components/CommentLabels.js +++ b/client/coral-admin/src/components/CommentLabels.js @@ -14,9 +14,11 @@ function isUserFlagged(actions) { function getUserFlaggedType(actions) { return actions - .filter((action) => action.__typename === 'FlagAction' && action.user) - .map((action) => action.user.roles.some((role) => staffRoles.includes(role))) - .some((staff) => staff) ? 'Staff' : 'User'; + .some((action) => + action.__typename === 'FlagAction' && + action.user && + action.user.roles.some((role) => staffRoles.includes(role)) + ) ? 'Staff' : 'User'; } function hasSuspectedWords(actions) {