Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

temporary fix for a collateral effect #28 #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ Database.prototype.enforceUniqueness = function(collectionName, values, updatedI
if(!attrDef.unique) continue;

for (var index in this.data[collectionName]) {

if (typeof this.data[collectionName][index] === "undefined" || this.data[collectionName][index] === null) continue;

// Ignore uniqueness check on undefined values
// (they shouldn't have been stored anyway)
if (_.isUndefined(values[attrName])) continue;
Expand Down