Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Add a bit of safety around reading events for room settings #2648

Merged
merged 1 commit into from
Feb 19, 2019

Conversation

turt2live
Copy link
Member

@turt2live turt2live requested a review from a team February 14, 2019 18:28
@@ -116,7 +116,8 @@ export default class RolesRoomSettingsTab extends React.Component {
_onPowerLevelsChanged = (value, powerLevelKey) => {
const client = MatrixClientPeg.get();
const room = client.getRoom(this.props.roomId);
let plContent = room.currentState.getStateEvents('m.room.power_levels', '').getContent() || {};
const plEvent = room.currentState.getStateEvents('m.room.power_levels', '');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the JS SDK instead return a dummy object so that the methods still work without testing for them everywhere? This seems like it will get quite annoying to remember to do this everywhere.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not as that could easily break things that aren't Riot.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, seems fine to go with this for now at least.

@turt2live turt2live assigned jryans and unassigned turt2live Feb 16, 2019
@turt2live turt2live requested a review from jryans February 16, 2019 06:18
@jryans jryans assigned turt2live and unassigned jryans Feb 18, 2019
@turt2live turt2live merged commit 424de00 into develop Feb 19, 2019
@turt2live turt2live deleted the travis/fix-room-settings branch February 19, 2019 04:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants