diff --git a/server/models/Collection.js b/server/models/Collection.js index a3f9dc8f..79512700 100644 --- a/server/models/Collection.js +++ b/server/models/Collection.js @@ -297,7 +297,7 @@ Collection.prototype.removeDocument = async function( if (options.deleteDocument) { const childDocument = await Document.findById(id); // Delete the actual document - await childDocument.destroy(); + if (childDocument) await childDocument.destroy(); // Delete all child documents await deleteChildren(id); }