Skip to content

Commit

Permalink
fix(logs): fixes corruption or arrays of strings in cleanupData (refs #…
Browse files Browse the repository at this point in the history
  • Loading branch information
naholyr committed Sep 25, 2017
1 parent c00ca3f commit d872a62
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/lib/edit-logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d872a62

Please sign in to comment.