Skip to content

Commit

Permalink
Merge pull request #28366 from situchan/fix-crash-room-name
Browse files Browse the repository at this point in the history
fix crash on room name validation

(cherry picked from commit 6093340)
  • Loading branch information
Joel Bettner authored and OSBotify committed Oct 1, 2023
1 parent 019618d commit 683384f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/ValidationUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ function isReservedRoomName(roomName: string): boolean {
/**
* Checks if the room name already exists.
*/
function isExistingRoomName(roomName: string, reports: Report[], policyID: string): boolean {
return reports.some((report) => report && report.policyID === policyID && report.reportName === roomName);
function isExistingRoomName(roomName: string, reports: Record<string, Report>, policyID: string): boolean {
return Object.values(reports).some((report) => report && report.policyID === policyID && report.reportName === roomName);
}

/**
Expand Down

0 comments on commit 683384f

Please sign in to comment.