-
Notifications
You must be signed in to change notification settings - Fork 340
Open
Labels
bugSomething isn't workingSomething isn't working
Description
This PR fixes a crash that occurs when a user types an unknown slash command (e.g., /hello) and presses Enter.
Previously, entering a slash command that does not exist in the client-side commands list caused the application to crash with a TypeError. This PR ensures that the client handles unknown slash commands gracefully and aligns behavior with standard Rocket.Chat expectations.
Steps to Reproduce
- Open EmbeddedChat.
- Type
/hello(or any unknown slash command) in the chat input. - Press Enter.
Observed Behavior
The application crashes with the following error:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'command')
at CommandsList.js:33
at HTMLDocument.handleKeyPress (CommandsList.js:54)
Expected Behavior
- The message
/helloshould be sent to the server. - The server should respond with
No such command: /hello(standard Rocket.Chat behavior). - At a minimum, the client should not crash.
- Add a defensive check to ensure
selectedItemexists before accessing its properties.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working