Skip to content

Commit db0e30b

Browse files
committed
apply code review
1 parent ca338ca commit db0e30b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • packages/apps/deno-runtime/lib

packages/apps/deno-runtime/lib/room.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { IUser } from '@rocket.chat/apps-engine/definition/users/IUser';
66
interface IRoomManager {
77
getBridges(): {
88
getInternalBridge(): {
9-
doGetUsernamesOfRoomById(id: string | undefined): Promise<Array<string>>;
9+
doGetUsernamesOfRoomById(id: string): Promise<Array<string>>;
1010
};
1111
};
1212
}
@@ -50,6 +50,8 @@ export class Room {
5050
* @deprecated
5151
*/
5252
public get usernames(): Promise<Array<string>> {
53+
if (!this.id) return Promise.resolve([]);
54+
5355
if (!this._USERNAMES) {
5456
this._USERNAMES = this[PrivateManager]?.getBridges().getInternalBridge().doGetUsernamesOfRoomById(this.id);
5557
}

0 commit comments

Comments
 (0)