mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 03:52:14 +00:00
Added check for user object to prevent errors
This commit is contained in:
parent
1a725c0515
commit
23e7a8e258
1 changed files with 3 additions and 2 deletions
|
|
@ -37,8 +37,9 @@ var populateQuery = function(type, q, additionalFields, user){
|
|||
if (type == 'party')
|
||||
q.populate('members', partyFields + (additionalFields ? (' ' + additionalFields) : ''));
|
||||
else
|
||||
//Use Conditional Semantics to always include the user
|
||||
guildPopulate.match = {"_id": { "$ne" : null, "$in": [user._id] } };
|
||||
if ( user )
|
||||
//Use Conditional Semantics to always include the user
|
||||
guildPopulate.match = {"_id": { "$ne" : null, "$in": [user._id] } };
|
||||
q.populate(guildPopulate);
|
||||
q.populate('invites', nameFields);
|
||||
q.populate({
|
||||
|
|
|
|||
Loading…
Reference in a new issue