Skip to content

Commit

Permalink
do not throw if room is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Junjiequan committed Oct 3, 2024
1 parent 3cf325f commit 53614a8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/controllers/logbook.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ export class LogbookController {
try {
const accessToken = this.tokenServiceManager.getToken();
const filter = this.createSynapseFilter();
console.log("Fetching messages for all rooms");
const { rooms } = await this.synapseService.fetchAllRoomsMessages(
filter,
accessToken,
Expand Down Expand Up @@ -214,9 +213,12 @@ export class LogbookController {
name,
accessToken,
);
const roomId = (allRooms.rooms.pop() as ChatRoom)?.room_id;

const roomId = (allRooms.rooms.pop() as ChatRoom).room_id;

if (!roomId) {
console.log(`Room - ${name} do not exist`);
return undefined;
}
const defaultFilter: LogbookFilters = {
textSearch: "",
showBotMessages: true,
Expand Down

0 comments on commit 53614a8

Please sign in to comment.