From d54750ef1925cabf55c4b0b0a8fd9656502a4710 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 30 Sep 2018 18:31:42 -0700 Subject: [PATCH] Closes #769 --- server/models/Collection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }