Removed 'cannot find id of undefined' warning

master
Keith Irwin 2017-05-23 13:04:01 -04:00
parent 75e9dcd72a
commit 5b3b03f44c
No known key found for this signature in database
GPG Key ID: 378933C743E2BBC0
1 changed files with 3 additions and 1 deletions

View File

@ -23,8 +23,10 @@ router.get('/:slug?', (req,res,next)=>{
.then( (mapuser)=>{
if (!mapuser){ next(); } //404
else {
const active = '';
if (req.user && req.user.id===mapuser.id){ active='map'; }
res.render('map', {
active:(req.user.id===mapuser.id)?'map':'',
active: active,
mapuser: mapuser,
mapApi: env.googleMapsAPI,
user: req.user,