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

Commit de8c5fb

Browse files
committed
don't die if no crypto
1 parent babbbfd commit de8c5fb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/settings/controllers/InvisibleCryptoController.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import { SettingLevel } from "../SettingLevel";
1212

1313
export default class InvisibleCryptoController extends SettingController {
1414
public onChange(level: SettingLevel, roomId: string, newValue: any): void {
15-
MatrixClientPeg.safeGet()
16-
.getCrypto()!
17-
.setCryptoMode(newValue ? CryptoMode.Invisible : CryptoMode.Legacy);
15+
const crypto = MatrixClientPeg.safeGet().getCrypto();
16+
if (crypto) {
17+
crypto.setCryptoMode(newValue ? CryptoMode.Invisible : CryptoMode.Legacy);
18+
}
1819
}
1920
}

0 commit comments

Comments
 (0)