themeteorchef / base

A starting point for Meteor apps.
http://themeteorchef.com/base
MIT License
690 stars 253 forks source link

Destructuring function parameter throws TypeError #201

Closed beauremus closed 7 years ago

beauremus commented 7 years ago

In the document-editor.js module, the upsertDocument.call destructures the second parameter. The second parameter will be undefined on an error and throw a TypeError rather than allowing the error parameter to be passed to the function and handled by Bert. I have changed the second parameter to a regular variable and refer to insertedId later using response.insertedId. This can be tested by changing the required type in the schema file and then passing in the wrong type through the form.