@dhyasama/totem-models 1.17.6 → 1.17.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Organization.js +1 -0
- package/package.json +1 -1
package/lib/Organization.js
CHANGED
|
@@ -493,6 +493,7 @@ module.exports = function(mongoose, config) {
|
|
|
493
493
|
|
|
494
494
|
// Check if person is already added
|
|
495
495
|
var match = _.find(self.people, function(existingPerson) {
|
|
496
|
+
if (existingPerson.person == null) return null;
|
|
496
497
|
var id = utils.isValidObjectId(existingPerson.person) ? existingPerson.person : existingPerson.person.id;
|
|
497
498
|
return id.toString() == personToAdd.person.toString();
|
|
498
499
|
});
|