Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit a16e6da

Browse files
authored
Guard around SpaceStore onAccountData handler prevEvent (#7123)
1 parent 98ea2c3 commit a16e6da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/stores/spaces/SpaceStore.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -748,9 +748,9 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
748748
}
749749
};
750750

751-
private onAccountData = (ev: MatrixEvent, lastEvent: MatrixEvent) => {
751+
private onAccountData = (ev: MatrixEvent, prevEvent?: MatrixEvent) => {
752752
if (!this.allRoomsInHome && ev.getType() === EventType.Direct) {
753-
const lastContent = lastEvent.getContent();
753+
const lastContent = prevEvent?.getContent() ?? {};
754754
const content = ev.getContent();
755755

756756
const diff = objectDiff<Record<string, string[]>>(lastContent, content);

0 commit comments

Comments
 (0)