Fix missing profile checks.

Thanks to justinr1234 !
This commit is contained in:
Lauri Ojansivu 2019-05-09 14:32:38 +03:00
parent 434ed895ed
commit 64ee60a008
14 changed files with 42 additions and 36 deletions

View file

@ -172,7 +172,7 @@ export class Exporter {
};
result.users = Users.find(byUserIds, userFields).fetch().map((user) => {
// user avatar is stored as a relative url, we export absolute
if (user.profile.avatarUrl) {
if ((user.profile || {}).avatarUrl) {
user.profile.avatarUrl = FlowRouter.url(user.profile.avatarUrl);
}
return user;