You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Don't explode if the SdkConfig isn't available
This can happen prior to logging in, for some reason. Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
@@ -64,7 +64,7 @@ module.exports = React.createClass({
|
||||
value={this.props.value}
|
||||
checked={val === this.props.value}
|
||||
onChange={this.onChange}
|
||||
/>
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@ import SdkConfig from "../SdkConfig";
|
||||
*/
|
||||
export default class ConfigSettingsHandler extends SettingsHandler {
|
||||
getValue(settingName, roomId) {
|
||||
const settingsConfig = SdkConfig.get()["settingDefaults"];
|
||||
const config = SdkConfig.get() || {};
|
||||
const settingsConfig = config["settingDefaults"];
|
||||
if (!settingsConfig || !settingsConfig[settingName]) return null;
|
||||
return settingsConfig[settingName];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user