Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roles.common line 782, rev is undefined #318

Closed
ggerber opened this issue Mar 7, 2020 · 2 comments
Closed

roles.common line 782, rev is undefined #318

ggerber opened this issue Mar 7, 2020 · 2 comments

Comments

@ggerber
Copy link

ggerber commented Mar 7, 2020

Hi,

I received the above error in my browser console.

I am unable to reproduce it at the moment as the error does not occur consistently.

This is probably similar to closed issue #311, r is undefined

@SimonSimCity
Copy link
Member

Can you please provide me with a sample? I cannot think of a possibility how this could be.

return [...new Set(roles.reduce((rev, current) => {
if (current.inheritedRoles) {
return rev.concat(current.inheritedRoles.map(r => r._id))
} else if (current.role) {
rev.push(current.role._id)
}
return rev
}, []))]

In the latest version (which as of the time writing is 3.2.2) I give the function reduce() an empty array and let the reducer return this very same array - unless the property current.inheritedRoles is truethy, in which case I return the result of a array.concat() function, which in any case should again return an array - so I'm very curious to see a sample.

@SimonSimCity
Copy link
Member

Closed due to lack of feedback. As it seems similar to #311, which was closed in v3.2.1, I expect it to be fixed in the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants