Fixes #649 – cant delete a draft document that has had its collection previously removed
This commit is contained in:
@ -412,7 +412,7 @@ router.post('documents.delete', auth(), async ctx => {
|
||||
authorize(ctx.state.user, 'delete', document);
|
||||
|
||||
const collection = document.collection;
|
||||
if (collection.type === 'atlas') {
|
||||
if (collection && collection.type === 'atlas') {
|
||||
// Delete document and all of its children
|
||||
await collection.removeDocument(document);
|
||||
}
|
||||
|
Reference in New Issue
Block a user