1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Address review feedback

This commit is contained in:
Brad Murray
2021-07-23 16:25:39 -04:00
parent 91f5df1e48
commit ad79a64f1c

View File

@@ -338,7 +338,7 @@ export class MatrixEvent extends EventEmitter {
return {} as T;
}
if (this.clearEvent) {
return this.clearEvent.content as T;
return (this.clearEvent.content || {}) as T;
}
return (this.event.content || {}) as T;
}
@@ -732,10 +732,7 @@ export class MatrixEvent extends EventEmitter {
* @returns {Object} The cleartext (decrypted) content for the event
*/
public getClearContent(): IContent | null {
if (this.clearEvent) {
return this.clearEvent.content;
}
return null;
return this.clearEvent?.content || null;
}
/**