Tell me more ×  I have running in my Mac a Node.JS server, and,
I access to it from other computer, the server doesn't crash,
but, I don't know why, the application crashes when I access
from my iPad. If I access from Safari, the server works, but,
with Chrome for iPad, the app crash!  This is the error:
TypeError: Cannot read property 'following' of null. Why this
happens?   app.get('/home', middleware.yeses, function (req,
res){   console.log(req.session.user + "\n\n");
UserModel.find({ user: req.session.user }, function (err, user){
res.render('home.ejs', {           username: req.session.user,
avatar: user[0].avatar,                      following:
user[0].following.length,          followers:
user[0].followers.length      I changed the console.log(user);
to this console.log(user[0].following). And there's no problem.
I don't know why, there's a problem with it in the locals.
share|improve this question You're going to have to post the
relevant code. –  Musa Jan 2 at 19:06 you are tryi