This was going along fine and now I’m having an exception error pop up. Can someone explain why I don’t get exception error with this, and then suddenly I do get exception error. Then if I delete the code and re-do it I won’t get an error for a while and then: BOOM EXCEPTION ERROR!
'user' : function(){
var aUser = UserList.find().fetch()[0];
console.log(aUser.name);
var aUser = aUser.name;
return aUser;
}
error:
xception in template helper: TypeError: Cannot read property ‘name’ of undefined
at Object.Template.hello.helpers.user (http://localhost:3000/v3.js?a2027bf3fb1d378aa84893eaec504af53766fc6d:15:24)
at bindDataContext (http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2880:16)
at Blaze._wrapCatchingExceptions (http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:1651:16)
at http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2928:66
at Function.Template._withTemplateInstanceFunc (http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:3476:12)
at wrapHelper (http://localhost:3000/packages/blaze.js?a5c324925e5f6e800a4c618d71caf2848b53bf51:2927:27)
at Spacebars.call (http://localhost:3000/packages/spacebars.js?7bafbe05ec09b6bbb6a3b276537e4995ab298a2f:172:18)
at Spacebars.mustacheImpl (http://localhost:3000/packages/spacebars.js?7bafbe05ec09b6bbb6a3b276537e4995ab298a2f:109:25)
at Object.Spacebars.mustache (http://localhost:3000/packages/spacebars.js?7bafbe05ec09b6bbb6a3b276537e4995ab298a2f:113:39)
at null._render (http://localhost:3000/template.v3.js?71758b4d9cf64358370ecc97b831d4566c80a396:12:22)
thanks,
Aaron