From 67e91174f24294d6e7fd190e836a2b68551b587a Mon Sep 17 00:00:00 2001 From: overthestream Date: Thu, 16 Nov 2023 14:47:18 +0900 Subject: [PATCH] null check --- src/auth/auth.controller.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/auth/auth.controller.ts b/src/auth/auth.controller.ts index aa4d54f..55c2fbe 100644 --- a/src/auth/auth.controller.ts +++ b/src/auth/auth.controller.ts @@ -145,7 +145,8 @@ export class AuthController { } const pageName = Object.keys(Page).find((key) => Page[key] == page); - if (!info[pageName]) throw new BadRequestException('invalid info'); + if (info[pageName] == undefined || info[pageName] == null) + throw new BadRequestException('invalid info'); switch (pageName) { case 'userName': await this.userService.updateUser(id, 'userName', info['userName']);