fix(base/conference/reducer): check if room is defined

This was hit on a corner case when ConnectionService will deny
the request to start the call. I am not sure, but it could have been
that the conference object has been disposed or closed or something
else, but the fact is that 'conference.room' was not defined and things
crashed. It is not safe to access conference's private field 'room'. It
is true JitsiConference doesn't follow the practice of marking this
field as private with the underscore '_', but it is not a public field.
This commit is contained in:
paweldomas 2019-06-20 12:00:13 -05:00 committed by Paweł Domas
parent 803870ef8f
commit 033aa0dd6e
1 changed files with 2 additions and 1 deletions

View File

@ -213,7 +213,8 @@ function _conferenceJoined(state, { conference }) {
// i.e. password-protected is private to lib-jitsi-meet. However, the // i.e. password-protected is private to lib-jitsi-meet. However, the
// library does not fire LOCK_STATE_CHANGED upon joining a JitsiConference // library does not fire LOCK_STATE_CHANGED upon joining a JitsiConference
// with a password. // with a password.
const locked = conference.room.locked ? LOCKED_REMOTELY : undefined; // FIXME Technically JitsiConference.room is a private field.
const locked = conference.room && conference.room.locked ? LOCKED_REMOTELY : undefined;
return assign(state, { return assign(state, {
authRequired: undefined, authRequired: undefined,