[FIX] Check attachments is defined before accessing first element#8295
Merged
rodrigok merged 1 commit intoRocketChat:developfrom Sep 25, 2017
Merged
Conversation
graywolf336
approved these changes
Sep 25, 2017
Contributor
graywolf336
left a comment
There was a problem hiding this comment.
This was done in a branch of my own, but glad to see it here.
Contributor
|
@rodrigok can we get this in the next pre-release, as it is a bug that can cause data loss. |
Contributor
Author
|
@graywolf336 what's the name of your branch? I just noticed https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-integrations/server/processWebhookMessage.js#L44, maybe it would be better to assign it to an empty array? |
Contributor
|
@Darkneon it's intermixed with a new feature, so don't worry about it. I would keep it like it is where you're checking it at. This way the |
Member
|
@graywolf336 Sure |
Contributor
|
@rodrigok thanks! |
rodrigok
added a commit
that referenced
this pull request
Sep 26, 2017
…ments [FIX] Check attachments is defined before accessing first element
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@RocketChat/core
Prevents an error if
attachmentsis undefined. It's not possible to create an empty message with no attachments in Rocket.Chat at the moment so this is mainly for those that are building on top of Rocket.Chat and are extending the message model.