Skip to content

Commit

Permalink
made changes to stop undefined length error when loading communities
Browse files Browse the repository at this point in the history
  • Loading branch information
Israellund committed Nov 19, 2024
1 parent 1ba693b commit 35eec35
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const useTopicGating = ({
acc.push(current);
// IMP: this logic can break if `PermissionEnum` or the `GroupPermissions`
// schema is changed substantially and might not give off a ts issue.
} else if (current.permissions.length > existing.permissions.length) {
} else if (current?.permissions?.length > existing?.permissions?.length) {
// Replace with the current item if it has a longer permission string
const index = acc.indexOf(existing);
acc[index] = current;
Expand Down

0 comments on commit 35eec35

Please sign in to comment.