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: discord crash on sending message to null channel #598

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

odilitime
Copy link
Collaborator

  • canSendMessage guard
  • don't call it twice in handleMessage

Risks

Low

Background

What does this PR do?

Fixes

Error handling message: TypeError: Cannot read properties of null (reading 'type')
at canSendMessage (file:///root/edward/packages/client-discord/dist/index.js:1727:17)
at MessageManager.handleMessage (file:///root/edward/packages/client-discord/dist/index.js:1833:18)
node:events:485
throw er; // Unhandled 'error' event
^

TypeError: Cannot read properties of null (reading 'type')
at MessageManager.handleMessage (file:///root/edward/packages/client-discord/dist/index.js:1930:33)
Emitted 'error' event on Client instance at:
    at emitUnhandledRejectionOrErr (node:events:390:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:92:21)

Node.js v23.1.0
[nodemon] app crashed - waiting for file changes before starting...

What kind of change is this?

Bug fixes (non-breaking change which fixes an issue)

Why are we doing this? Any context or related work?

Minor improvement to increase stability

Documentation changes needed?

My changes do not require a change to the project documentation.

- canSendMessage guard
- don't call it twice in handleMessage
@odilitime odilitime changed the title Fix discord crash Fix: discord crash Nov 25, 2024
@shakkernerd shakkernerd changed the title Fix: discord crash fix: discord crash on sending message to null channel Nov 25, 2024
@shakkernerd shakkernerd merged commit f9ba2bd into elizaOS:main Nov 25, 2024
2 of 4 checks passed
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.

2 participants