Merge pull request #20007 from prlanzarin/u27/fix/invalid-metadataprop-access
[2.7] fix(bbb-html5): crash due to undefined metadataProp access
This commit is contained in:
commit
2f3e709324
@ -2,11 +2,10 @@ import Auth from '/imports/ui/services/auth';
|
|||||||
import Meetings from '/imports/api/meetings';
|
import Meetings from '/imports/api/meetings';
|
||||||
|
|
||||||
export default function getFromMeetingSettings(setting, defaultValue) {
|
export default function getFromMeetingSettings(setting, defaultValue) {
|
||||||
const prop = Meetings.findOne(
|
const meeting = Meetings.findOne(
|
||||||
{ meetingId: Auth.meetingID },
|
{ meetingId: Auth.meetingID },
|
||||||
{ fields: { 'metadataProp': 1 } },
|
{ fields: { metadataProp: 1 } },
|
||||||
).metadataProp;
|
);
|
||||||
const value = prop.metadata ? prop.metadata[setting] : undefined;
|
|
||||||
|
|
||||||
return value || defaultValue;
|
return meeting?.metadataProp?.metadata?.[setting] ?? defaultValue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user