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

fix(Message): update getters to take null permissions into account #5066

Merged
merged 8 commits into from Jan 22, 2021

Conversation

zaida04
Copy link
Contributor

@zaida04 zaida04 commented Dec 1, 2020

#5056, check to make sure return from channel#permissionsFor isn't null before calling .has on it. Open to refactoring to avoid duplicate permissionsFor calls

closes #5056

Status

  • [] Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

Semantic versioning classification:

  • This PR changes the library's interface (methods or parameters added)
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • This PR only includes non-code changes, like changes to documentation, README, etc.

@zaida04 zaida04 closed this Dec 1, 2020
@zaida04 zaida04 reopened this Dec 1, 2020
src/structures/Message.js Outdated Show resolved Hide resolved
src/structures/Message.js Outdated Show resolved Hide resolved
Copy link
Member

@vladfrangu vladfrangu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to handle reported issue first

@zaida04
Copy link
Contributor Author

zaida04 commented Dec 13, 2020

@vladfrangu resolved

src/structures/Message.js Outdated Show resolved Hide resolved
Co-authored-by: Jan <66554238+Vaporox@users.noreply.github.com>
@NotSugden
Copy link
Contributor

NotSugden commented Dec 15, 2020

the same error also happens for Message#pinnable, which is right underneath this getter, it would make sense to include it in this PR too

edit: also happens for another getter Message#crosspostable, maybe a couple more

edit: this could happen on quite a few getters, the two named above, a couple in VoiceChannel and possibly more

@zaida04 zaida04 changed the title fix(Message): update message#delete to account for null permissions fix(Message): update getters to take null permissions into account Dec 16, 2020
@iCrawl iCrawl merged commit 98b1c58 into discordjs:master Jan 22, 2021
@zaida04 zaida04 deleted the patch-1 branch February 2, 2021 15:18
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Channel permissionsFor can be null
7 participants