Use MatrixClientPeg::safeGet for strict typing (#10989)
This commit is contained in:
parent
d64018ce26
commit
9b5b053148
60 changed files with 225 additions and 203 deletions
|
@ -64,7 +64,7 @@ export class PlaybackQueue {
|
|||
}
|
||||
|
||||
public static forRoom(roomId: string): PlaybackQueue {
|
||||
const cli = MatrixClientPeg.get();
|
||||
const cli = MatrixClientPeg.safeGet();
|
||||
const room = cli.getRoom(roomId);
|
||||
if (!room) throw new Error("Unknown room");
|
||||
if (PlaybackQueue.queues.has(room.roomId)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue