Fixed singlecharacter publication returning undefined rather than an empty array
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
Meteor.publish("singleCharacter", function(characterId){
|
Meteor.publish("singleCharacter", function(characterId){
|
||||||
userId = this.userId;
|
userId = this.userId;
|
||||||
|
if (!userId) return [];
|
||||||
var char = Characters.findOne({
|
var char = Characters.findOne({
|
||||||
_id: characterId,
|
_id: characterId,
|
||||||
$or: [
|
$or: [
|
||||||
@@ -30,5 +31,7 @@ Meteor.publish("singleCharacter", function(characterId){
|
|||||||
{fields: {username: 1}}
|
{fields: {username: 1}}
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user