From 59175926c67fd35af8c4416a8d160077413e9d9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Castillo?= Date: Fri, 24 Oct 2025 16:30:15 -0300 Subject: [PATCH] fix: add catch to avoid return undefined types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Castillo --- src/components/forms/room-form.js | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/components/forms/room-form.js b/src/components/forms/room-form.js index 875ea4bd4..f0b057c1d 100644 --- a/src/components/forms/room-form.js +++ b/src/components/forms/room-form.js @@ -166,17 +166,22 @@ class RoomForm extends React.Component { } }; - const roomAttributes = entity.attributes.map((attr) => { - const attributeTypes = - currentSummit.meeting_booking_room_allowed_attributes; - const type = attributeTypes.find((at) => at.id === attr.type_id); - - return { - ...attr, - label: `${type.type}: ${attr.value}`, - type_name: type.type - }; - }); + const roomAttributes = entity.attributes + .map((attr) => { + const attributeTypes = + currentSummit.meeting_booking_room_allowed_attributes; + const type = attributeTypes.find((at) => at.id === attr.type_id); + + if (!type) return null; + + return { + ...attr, + label: `${type.type}: ${attr.value}`, + type_name: type.type + }; + }) + // filter null values + .filter(Boolean); const class_ddl = [ { label: "Room", value: "SummitVenueRoom" },