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] Error when trying to show preview of undefined filetype #6935

Merged
merged 2 commits into from
May 11, 2017

Conversation

geekgonecrazy
Copy link
Member

@geekgonecrazy geekgonecrazy commented May 10, 2017

closes #6922
closes #6917

@RocketChat/core

Closes #ISSUE_NUMBER

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6935 May 10, 2017 18:40 Inactive
@@ -9,6 +9,8 @@ getUploadPreview = (file, callback) ->
# If greater then 10MB don't try and show a preview
if file.file.size > 10 * 1000000
callback(file, null)
else if file.file.type is undefined
Copy link
Member

Choose a reason for hiding this comment

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

maybe testing any falsy value would be safier.. what do you think? like else if not file.file.type?

Copy link
Member Author

Choose a reason for hiding this comment

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

Of course 👍 makes sense. That's coffeescript for you lol

@engelgabriel engelgabriel added this to the 0.57.0 milestone May 11, 2017
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6935 May 11, 2017 19:18 Inactive
@geekgonecrazy
Copy link
Member Author

@sampaiodiego fixed 👍

@rodrigok rodrigok changed the base branch from develop to release-candidate May 11, 2017 19:31
@rodrigok rodrigok changed the base branch from release-candidate to develop May 11, 2017 19:31
@rodrigok rodrigok merged commit 2543348 into develop May 11, 2017
@rodrigok rodrigok deleted the fix-6917 branch May 11, 2017 19:31
rodrigok added a commit that referenced this pull request May 11, 2017
[Fix] Error when trying to show preview of undefined filetype
@staticjinno
Copy link

i'm on 0.57.3. i'm able to upload an extension-less file, but trying to download it will fail in browser & do nothing in app.

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.

Cannot send files Error uploading file when mime type is undefined and size < 10mb.
5 participants