Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot join Meteor.users if not logged in #15

Open
Torone opened this issue Jul 27, 2017 · 1 comment
Open

Cannot join Meteor.users if not logged in #15

Torone opened this issue Jul 27, 2017 · 1 comment

Comments

@Torone
Copy link

Torone commented Jul 27, 2017

Hi,

I have a collection called Messages and I'm trying to join it with Meteor.users to get the author name:

export const Messages = new Mongo.Collection('messages');

Messages.join(Meteor.users, '_author', 'author', ['profile']);

if (Meteor.isServer) {
  Meteor.publish('messages', function() {
    return Messages.find({}, {
      sort: { createdAt: -1 }
    });
  });
}

If I'm logged in I can see correctly the user name for my messages. If I logout I receive the following error:

Exception from Tracker recompute function:
TypeError: Cannot read property 'profile' of undefined
@perak
Copy link
Owner

perak commented Jul 28, 2017

Hi @Torone thanks for reporting issue, I'll check what's the problem and fix if possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants