From 1a445ca96bbe57f8e7b85d9f94dbecc61e4eade2 Mon Sep 17 00:00:00 2001 From: aadhavan valli Date: Sat, 17 Feb 2024 15:11:13 +0530 Subject: [PATCH] CHECKFROMDB : AADHAVAN --- app/controllers/jwt_controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/jwt_controller.js b/app/controllers/jwt_controller.js index 520a47d..dfe3ba0 100644 --- a/app/controllers/jwt_controller.js +++ b/app/controllers/jwt_controller.js @@ -15,9 +15,9 @@ module.exports.addMacValue= async(req, res, next)=>{ const {key, mac_id, mail, company_name, app_version} = req.body const mac =await MacModel.findOne({where:{licency_key: key},raw:true}); - //Check License Key IN DB - if (mac.licency_key == key) { + if (mac && mac.licency_key == key) + { //Check isActive and App Version are Same if (mac.isActive == false && mac.app_version == app_version) {