mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-27 03:04:54 +00:00
Merge pull request #246 from SyncrowIOT/fix-null-user-issue
Add optional chaining to user and invitedUser checks
This commit is contained in:
@ -181,7 +181,7 @@ export class InviteUserService {
|
||||
where: { email },
|
||||
relations: ['project'],
|
||||
});
|
||||
if (!user.isActive) {
|
||||
if (!user?.isActive) {
|
||||
throw new HttpException('This user is deleted', HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
if (user?.project) {
|
||||
@ -195,7 +195,7 @@ export class InviteUserService {
|
||||
where: { email },
|
||||
relations: ['project'],
|
||||
});
|
||||
if (!invitedUser.isActive) {
|
||||
if (!invitedUser?.isActive) {
|
||||
throw new HttpException('This user is deleted', HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
if (invitedUser?.project) {
|
||||
|
||||
Reference in New Issue
Block a user