Skip to content

Commit

Permalink
null check
Browse files Browse the repository at this point in the history
  • Loading branch information
overthestream committed Nov 16, 2023
1 parent 9d7b355 commit 67e9117
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit 67e9117

Please sign in to comment.