From d12e8e1116a7ec935254a2b4b1b9559a282a1bb5 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 11 Dec 2015 15:24:49 +0200 Subject: [PATCH] closes #3814 --- src/controllers/accounts/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/accounts/helpers.js b/src/controllers/accounts/helpers.js index 77a71aba66..9a679cd49a 100644 --- a/src/controllers/accounts/helpers.js +++ b/src/controllers/accounts/helpers.js @@ -59,7 +59,7 @@ helpers.getUserDataByUserSlug = function(userslug, callerUID, callback) { userData.joindateISO = utils.toISOString(userData.joindate); userData.lastonlineISO = utils.toISOString(userData.lastonline || userData.joindate); - userData.age = userData.birthday ? Math.floor((new Date().getTime() - new Date(userData.birthday).getTime()) / 31536000000) : ''; + userData.age = Math.max(0, userData.birthday ? Math.floor((new Date().getTime() - new Date(userData.birthday).getTime()) / 31536000000) : 0); if (!(isAdmin || self || (userData.email && userSettings.showemail))) { userData.email = '';