diff --git a/server/lib/edit-logs.js b/server/lib/edit-logs.js index 527bd0d1..d6b3911e 100644 --- a/server/lib/edit-logs.js +++ b/server/lib/edit-logs.js @@ -155,6 +155,10 @@ const cleanupData = (data, subDoc = false, returnNullIfNotModified = false) => { return returnNullIfNotModified ? null : data } + if (typeof data !== 'object') { + return data + } + // Sub-document: if it has an id, the whole object should be replace with this value if (subDoc && data._id instanceof mongoose.mongo.ObjectID) { return getID(data)