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" },