fix typos and NPE. fixes #5999

pull/21833/head
Matthew Hodgson 2018-01-17 23:25:39 +00:00
parent 27b27e3759
commit d3292d9388
1 changed files with 2 additions and 2 deletions

View File

@ -857,8 +857,8 @@ module.exports = withMatrixClient(React.createClass({
}
const room = this.props.matrixClient.getRoom(this.props.member.roomId);
const poweLevelEvent = room ? room.currentState.getStateEvents("m.room.power_levels", "") : null;
const powerLevelUsersDefault = poweLevelEvent.getContent().users_default;
const powerLevelEvent = room ? room.currentState.getStateEvents("m.room.power_levels", "") : null;
const powerLevelUsersDefault = powerLevelEvent ? powerLevelEvent.getContent().users_default : 0;
let roomMemberDetails = null;
if (this.props.member.roomId) { // is in room