Skip to content

Commit 44d2e47

Browse files
authored
Fix invite processing on Element-R (#3121)
Currently, whenever we receive an invite on element R, it crashes the sync loop. A quick fix to make it not do that.
1 parent 8f5db46 commit 44d2e47

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/sync.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1254,11 +1254,12 @@ export class SyncApi {
12541254

12551255
const inviter = room.currentState.getStateEvents(EventType.RoomMember, client.getUserId()!)?.getSender();
12561256

1257-
if (client.isCryptoEnabled()) {
1258-
const parkedHistory = await client.crypto!.cryptoStore.takeParkedSharedHistory(room.roomId);
1257+
const crypto = client.crypto;
1258+
if (crypto) {
1259+
const parkedHistory = await crypto.cryptoStore.takeParkedSharedHistory(room.roomId);
12591260
for (const parked of parkedHistory) {
12601261
if (parked.senderId === inviter) {
1261-
await client.crypto!.olmDevice.addInboundGroupSession(
1262+
await crypto.olmDevice.addInboundGroupSession(
12621263
room.roomId,
12631264
parked.senderKey,
12641265
parked.forwardingCurve25519KeyChain,

0 commit comments

Comments
 (0)