From 53f408aff8b45a3cd160adedce794de42e210b09 Mon Sep 17 00:00:00 2001 From: totregex <150310085+totregex@users.noreply.github.com> Date: Sun, 28 Apr 2024 17:06:08 +0530 Subject: [PATCH] third --- routes/staticRoutes.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routes/staticRoutes.js b/routes/staticRoutes.js index 0358a81..53c7a99 100644 --- a/routes/staticRoutes.js +++ b/routes/staticRoutes.js @@ -5,7 +5,8 @@ const router = express.Router() router.get('/', (req,res)=>{ const uid = req.cookies?.uid; const user = getUser(uid); - const username = user.name; + var username=null; + if(user){username = user.name;} return res.render('home',{ username:username });