Conform more code to strict null checking (#10153)

* Conform more code to strict null checking

* Conform more code to strict null checking

* Iterate

* Iterate
This commit is contained in:
Michael Telatynski 2023-02-15 13:36:22 +00:00 committed by GitHub
parent a4ff959aa1
commit 145a5a8a8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
89 changed files with 520 additions and 551 deletions

View file

@ -217,10 +217,10 @@ export default class HTMLExporter extends Exporter {
</html>`;
}
protected getAvatarURL(event: MatrixEvent): string | undefined {
protected getAvatarURL(event: MatrixEvent): string | null {
const member = event.sender;
const avatarUrl = member?.getMxcAvatarUrl();
return avatarUrl ? mediaFromMxc(avatarUrl).getThumbnailOfSourceHttp(30, 30, "crop") : undefined;
return avatarUrl ? mediaFromMxc(avatarUrl).getThumbnailOfSourceHttp(30, 30, "crop") : null;
}
protected async saveAvatarIfNeeded(event: MatrixEvent): Promise<void> {
@ -386,7 +386,7 @@ export default class HTMLExporter extends Exporter {
protected async createHTML(events: MatrixEvent[], start: number): Promise<string> {
let content = "";
let prevEvent = null;
let prevEvent: MatrixEvent | null = null;
for (let i = start; i < Math.min(start + 1000, events.length); i++) {
const event = events[i];
this.updateProgress(