From 5be23253f4497f7ed0a8e686da017a65c79752d7 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 15 Jun 2022 13:29:32 +0530 Subject: [PATCH] refactor: wrap within if condition Signed-off-by: Pranav C --- packages/nocodb/src/lib/models/User.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/lib/models/User.ts b/packages/nocodb/src/lib/models/User.ts index de39bbe582..a1a91aada5 100644 --- a/packages/nocodb/src/lib/models/User.ts +++ b/packages/nocodb/src/lib/models/User.ts @@ -48,7 +48,9 @@ export default class User implements UserType { 'token_version' ]); - insertObj.email = insertObj.email?.toLowerCase(); + if (insertObj.email) { + insertObj.email = insertObj.email.toLowerCase(); + } const { id } = await ncMeta.metaInsert2( null, @@ -80,7 +82,9 @@ export default class User implements UserType { 'token_version' ]); - updateObj.email = updateObj.email?.toLowerCase(); + if (updateObj.email) { + updateObj.email = updateObj.email.toLowerCase(); + } // get existing cache const keys = [ // update user: