Fix crash

This commit is contained in:
nielsandriesse 2020-09-30 10:13:49 +10:00
parent 731f303a92
commit 81b019c94f
1 changed files with 7 additions and 5 deletions

View File

@ -649,11 +649,13 @@ const CGFloat kIconViewLength = 24;
// Group settings section.
__block BOOL isUserMember;
NSString *userPublicKey = OWSIdentityManager.sharedManager.identityKeyPair.hexEncodedPublicKey;
[LKStorage readWithBlock:^(YapDatabaseReadTransaction *transaction) {
isUserMember = [(TSGroupThread *)self.thread isUserMemberInGroup:userPublicKey transaction:transaction];
}];
__block BOOL isUserMember = NO;
if (self.isGroupThread) {
NSString *userPublicKey = OWSIdentityManager.sharedManager.identityKeyPair.hexEncodedPublicKey;
[LKStorage readWithBlock:^(YapDatabaseReadTransaction *transaction) {
isUserMember = [(TSGroupThread *)self.thread isUserMemberInGroup:userPublicKey transaction:transaction];
}];
}
if (self.isGroupThread && self.isPrivateGroupChat && isUserMember) {
if (((TSGroupThread *)self.thread).usesSharedSenderKeys) {