Use MatrixClientPeg::safeGet in src/components/views/* (#10987)

This commit is contained in:
Michael Telatynski 2023-06-15 08:46:19 +01:00 committed by GitHub
parent 4243847f4f
commit 280f6a9d93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
81 changed files with 265 additions and 250 deletions

View file

@ -93,7 +93,7 @@ export default class ChangePassword extends React.Component<IProps, IState> {
}
private async onChangePassword(oldPassword: string, newPassword: string): Promise<void> {
const cli = MatrixClientPeg.get();
const cli = MatrixClientPeg.safeGet();
// if the server supports it then don't sign user out of all devices
const serverSupportsControlOfDevicesLogout = await cli.doesServerSupportLogoutDevices();
@ -235,7 +235,7 @@ export default class ChangePassword extends React.Component<IProps, IState> {
typeof ExportE2eKeysDialog
>,
{
matrixClient: MatrixClientPeg.get(),
matrixClient: MatrixClientPeg.safeGet(),
},
);
};