From 683384f804967e72e77a351854b1521a39d37dc8 Mon Sep 17 00:00:00 2001 From: Joel Bettner Date: Fri, 29 Sep 2023 09:38:35 +0800 Subject: [PATCH] Merge pull request #28366 from situchan/fix-crash-room-name fix crash on room name validation (cherry picked from commit 609334065339613d86456f2af87f089e04353ef3) --- src/libs/ValidationUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/ValidationUtils.ts b/src/libs/ValidationUtils.ts index 80b15690ac46..b94c240b6e92 100644 --- a/src/libs/ValidationUtils.ts +++ b/src/libs/ValidationUtils.ts @@ -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, policyID: string): boolean { + return Object.values(reports).some((report) => report && report.policyID === policyID && report.reportName === roomName); } /**