Skip to content

Commit

Permalink
Include decryption block inside synchronisation block
Browse files Browse the repository at this point in the history
  • Loading branch information
Anderas committed Aug 30, 2022
1 parent cc53e14 commit 02b3541
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions MatrixSDK/Crypto/MXOlmDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -544,17 +544,16 @@ - (void)performGroupSessionOperationWithSessionId:(NSString*)sessionId senderKey

if (enableCache)
{
__block MXOlmInboundGroupSession *session;
@synchronized (self.inboundGroupSessionCache)
{
session = (MXOlmInboundGroupSession *)[self.inboundGroupSessionCache get:sessionId];
MXOlmInboundGroupSession *session = (MXOlmInboundGroupSession *)[self.inboundGroupSessionCache get:sessionId];
if (!session)
{
session = [store inboundGroupSessionWithId:sessionId andSenderKey:senderKey];
[self.inboundGroupSessionCache put:sessionId object:session];
}
block(session);
}
block(session);
}
else
{
Expand Down

0 comments on commit 02b3541

Please sign in to comment.