This commit is contained in:
Tom Moor
2018-09-30 18:31:42 -07:00
parent 283fad5f87
commit d54750ef19

View File

@ -297,7 +297,7 @@ Collection.prototype.removeDocument = async function(
if (options.deleteDocument) { if (options.deleteDocument) {
const childDocument = await Document.findById(id); const childDocument = await Document.findById(id);
// Delete the actual document // Delete the actual document
await childDocument.destroy(); if (childDocument) await childDocument.destroy();
// Delete all child documents // Delete all child documents
await deleteChildren(id); await deleteChildren(id);
} }