Conform more code to strictNullChecks
(#10383
* Update matrix-widget-api * Conform more code to `strictNullChecks` * Iterate
This commit is contained in:
parent
aae9dfbb7d
commit
9c816bb720
18 changed files with 112 additions and 93 deletions
|
@ -135,7 +135,7 @@ export default abstract class Exporter {
|
|||
let limit: number;
|
||||
switch (this.exportType) {
|
||||
case ExportType.LastNMessages:
|
||||
limit = this.exportOptions.numberOfMessages;
|
||||
limit = this.exportOptions.numberOfMessages!;
|
||||
break;
|
||||
case ExportType.Timeline:
|
||||
limit = 40;
|
||||
|
@ -221,11 +221,11 @@ export default abstract class Exporter {
|
|||
return events;
|
||||
}
|
||||
|
||||
protected async getMediaBlob(event: MatrixEvent): Promise<Blob> {
|
||||
let blob: Blob;
|
||||
protected async getMediaBlob(event: MatrixEvent): Promise<Blob | undefined> {
|
||||
let blob: Blob | undefined;
|
||||
try {
|
||||
const isEncrypted = event.isEncrypted();
|
||||
const content: IMediaEventContent = event.getContent();
|
||||
const content = event.getContent<IMediaEventContent>();
|
||||
const shouldDecrypt = isEncrypted && content.hasOwnProperty("file") && event.getType() !== "m.sticker";
|
||||
if (shouldDecrypt) {
|
||||
blob = await decryptFile(content.file);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue