Apply strictNullChecks around the codebase (#10302

* Apply `strictNullChecks` around the codebase

* Iterate PR
This commit is contained in:
Michael Telatynski 2023-03-07 13:19:18 +00:00 committed by GitHub
parent 7c2bb966d0
commit 4b8bada24b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 112 additions and 77 deletions

View file

@ -227,7 +227,11 @@ export default class DeviceListener {
// & cache the result
private async getKeyBackupInfo(): Promise<IKeyBackupInfo | null> {
const now = new Date().getTime();
if (!this.keyBackupInfo || this.keyBackupFetchedAt < now - KEY_BACKUP_POLL_INTERVAL) {
if (
!this.keyBackupInfo ||
!this.keyBackupFetchedAt ||
this.keyBackupFetchedAt < now - KEY_BACKUP_POLL_INTERVAL
) {
this.keyBackupInfo = await MatrixClientPeg.get().getKeyBackupVersion();
this.keyBackupFetchedAt = now;
}
@ -392,7 +396,7 @@ export default class DeviceListener {
private updateClientInformation = async (): Promise<void> => {
try {
if (this.shouldRecordClientInformation) {
await recordClientInformation(MatrixClientPeg.get(), SdkConfig.get(), PlatformPeg.get());
await recordClientInformation(MatrixClientPeg.get(), SdkConfig.get(), PlatformPeg.get() ?? undefined);
} else {
await removeClientInformation(MatrixClientPeg.get());
}