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(PresenceUpdate): use added presence over nullable getter #6077

Merged
merged 2 commits into from
Jul 8, 2021

Conversation

SpaceEEC
Copy link
Member

@SpaceEEC SpaceEEC commented Jul 8, 2021

Please describe the changes this PR makes and why it should be merged:

This PR fixes #6075 by using the presence returned from PresenceManager#add.

The cause for this is a combined effort of #6013 and #6055:
The first would discard the presence on insertion (as intended when not caching them), causing the getter to return a default presence here.
With the second the default presence was removed, causing the getter to now return null, causing this crash.
I should have spotted that.

Status and versioning classification:

  • 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

@iCrawl iCrawl requested review from kyranet and vladfrangu July 8, 2021 10:35
@iCrawl iCrawl added this to the Version 13 milestone Jul 8, 2021
@iCrawl
Copy link
Member

iCrawl commented Jul 8, 2021

This needs a rebase.

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.

See vaporox's comment

@iCrawl iCrawl merged commit 637c8e0 into discordjs:master Jul 8, 2021
@SpaceEEC SpaceEEC deleted the fix/presence_update branch July 8, 2021 20:45
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.

Bot crashes after disabling presences cache
4 participants