Skip to content

Commit

Permalink
[FIX] room creation fails if app framework is disabled (#25200)
Browse files Browse the repository at this point in the history
  • Loading branch information
debdutdeb committed Apr 20, 2022
1 parent 9e712ea commit c63575a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/meteor/app/lib/server/functions/createRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ export const createRoom = function <T extends RoomType>(
throw new Meteor.Error('error-app-prevented', 'A Rocket.Chat App prevented the room creation.');
}

const { _USERNAMES, ...result } = Promise.await(
const eventResult = Promise.await(
Apps.triggerEvent('IPreRoomCreateModify', Promise.await(Apps.triggerEvent('IPreRoomCreateExtend', tmp))),
);

if (typeof result === 'object') {
Object.assign(roomProps, result);
if (eventResult && typeof eventResult === 'object' && delete eventResult._USERNAMES) {
Object.assign(roomProps, eventResult);
}

if (type === 'c') {
Expand Down

0 comments on commit c63575a

Please sign in to comment.