Skip to content

Commit

Permalink
Merge pull request #410 from funkyremi/master
Browse files Browse the repository at this point in the history
Fix addfile() -> filename of undefined
  • Loading branch information
dr-dimitru authored May 18, 2017
2 parents 55e2ac7 + 4534d2c commit 4d16798
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions files.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1514,14 +1514,14 @@ class FilesCollection
self.collection.insert result, (error, _id) ->
if error
callback and callback error
console.warn "[FilesCollection] [addFile] [insert] Error: #{fileName} -> #{self.collectionName}", error if self.debug
console.warn "[FilesCollection] [addFile] [insert] Error: #{result.name} -> #{self.collectionName}", error if self.debug
else
fileRef = self.collection.findOne _id
callback and callback null, fileRef
if proceedAfterUpload is true
self.onAfterUpload and self.onAfterUpload.call self, fileRef
self.emit 'afterUpload', fileRef
console.info "[FilesCollection] [addFile]: #{fileName} -> #{self.collectionName}" if self.debug
console.info "[FilesCollection] [addFile]: #{result.name} -> #{self.collectionName}" if self.debug
return
else
callback and callback new Meteor.Error 400, "[FilesCollection] [addFile(#{path})]: File does not exist"
Expand Down

0 comments on commit 4d16798

Please sign in to comment.