Skip to content

Instantly share code, notes, and snippets.

@lorecrafting
Created October 25, 2014 20:29
Show Gist options
  • Save lorecrafting/c024b099dba0604ded20 to your computer and use it in GitHub Desktop.
Save lorecrafting/c024b099dba0604ded20 to your computer and use it in GitHub Desktop.
Template.addRoom.isBuilder = function(){
var currentUserEmail = Meteor.user().emails[0].address;
var builderEmail = 'builder@builder';
if (currentUserEmail === builderEmail){
return true;
} else{
return false;
}
};
//I get this error in the console upon loading website:
Exception in template helper: TypeError: Cannot read property 'emails' of undefined
at Object.Template.addRoom.isBuilder (http://localhost:3000/ProjectKnight.js?60544848623f86076be671b43c71fe3a0641fc1c:14:41)
at http://localhost:3000/packages/blaze.js?e22f88e24055201b48b93258f0a0a8e7b8b3a415:2448:16
at http://localhost:3000/packages/blaze.js?e22f88e24055201b48b93258f0a0a8e7b8b3a415:1552:16
at Object.Spacebars.call (http://localhost:3000/packages/spacebars.js?283d80c61ad2d96e20739c6394180af33bf6dd4b:169:18)
at Template.__define__.Blaze.If.HTML.FORM.id (http://localhost:3000/template.ProjectKnight.js?e78ba050a6c7ff17ef7d1dd8c9dd0523290de3bd:40:22)
at null.<anonymous> (http://localhost:3000/packages/blaze.js?e22f88e24055201b48b93258f0a0a8e7b8b3a415:2275:44)
at http://localhost:3000/packages/blaze.js?e22f88e24055201b48b93258f0a0a8e7b8b3a415:1805:16
at Object.Blaze.withCurrentView (http://localhost:3000/packages/blaze.js?e22f88e24055201b48b93258f0a0a8e7b8b3a415:2038:12)
at viewAutorun (http://localhost:3000/packages/blaze.js?e22f88e24055201b48b93258f0a0a8e7b8b3a415:1804:18)
at Deps.Computation._compute (http://localhost:3000/packages/deps.js?b8042fd8eaf6c998f471f7afcfaa3cd47abc4aec:214:36) debug.js:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment