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

Commit

Permalink
don't die if no crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
uhoreg committed Sep 18, 2024
1 parent babbbfd commit de8c5fb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/settings/controllers/InvisibleCryptoController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import { SettingLevel } from "../SettingLevel";

export default class InvisibleCryptoController extends SettingController {
public onChange(level: SettingLevel, roomId: string, newValue: any): void {
MatrixClientPeg.safeGet()
.getCrypto()!
.setCryptoMode(newValue ? CryptoMode.Invisible : CryptoMode.Legacy);
const crypto = MatrixClientPeg.safeGet().getCrypto();
if (crypto) {
crypto.setCryptoMode(newValue ? CryptoMode.Invisible : CryptoMode.Legacy);
}
}
}

0 comments on commit de8c5fb

Please sign in to comment.