Skip to content

Commit

Permalink
Merge pull request #6935 from RocketChat/fix-6917
Browse files Browse the repository at this point in the history
[Fix] Error when trying to show preview of undefined filetype
  • Loading branch information
rodrigok committed May 11, 2017
1 parent 607f6b8 commit 90c9ea7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/rocketchat-ui/client/lib/fileUpload.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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 not file.file.type?
callback(file, null)
else
if file.file.type.indexOf('audio') > -1 or file.file.type.indexOf('video') > -1 or file.file.type.indexOf('image') > -1
file.type = file.file.type.split('/')[0]
Expand Down

0 comments on commit 90c9ea7

Please sign in to comment.