Conform more of the codebase to strictNullChecks (#10842)

This commit is contained in:
Michael Telatynski 2023-05-11 09:56:56 +01:00 committed by GitHub
parent 5eea2c8b02
commit 82e32035fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 126 additions and 93 deletions

View file

@ -117,9 +117,9 @@ export abstract class Member {
/**
* Gets the MXC URL of this Member's avatar. For users this should be their profile's
* avatar MXC URL or null if none set. For 3PIDs this should always be null.
* avatar MXC URL or null if none set. For 3PIDs this should always be undefined.
*/
public abstract getMxcAvatarUrl(): string | null;
public abstract getMxcAvatarUrl(): string | undefined;
}
export class DirectoryMember extends Member {
@ -144,8 +144,8 @@ export class DirectoryMember extends Member {
return this._userId;
}
public getMxcAvatarUrl(): string | null {
return this.avatarUrl ?? null;
public getMxcAvatarUrl(): string | undefined {
return this.avatarUrl;
}
}
@ -173,8 +173,8 @@ export class ThreepidMember extends Member {
return this.id;
}
public getMxcAvatarUrl(): string | null {
return null;
public getMxcAvatarUrl(): string | undefined {
return undefined;
}
}