skip undefined userId
This commit is contained in:
parent
3906421aa0
commit
91777db7fb
@ -84,6 +84,10 @@ export abstract class BaseUserService<
|
||||
}
|
||||
|
||||
getName(user: string | Interface | Class): string | undefined {
|
||||
if (!user) {
|
||||
return;
|
||||
}
|
||||
|
||||
const userId = typeof user === 'string' ? user : user.userId;
|
||||
return this.find(userId)?.name;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user