Fix crash when messaging user for the first time

We trust on first use, so if there is no identity, no need to compare
key.

// FREEBIE
pull/1/head
Michael Kirk 9 years ago
parent 167961a45f
commit e408250ef2

@ -231,6 +231,12 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
@synchronized(self)
{
OWSRecipientIdentity *_Nullable recipientIdentity = [OWSRecipientIdentity fetchObjectWithUniqueID:recipientId];
if (recipientIdentity == nil) {
// trust on first use
return nil;
}
BOOL isTrusted = [self isTrustedIdentityKey:recipientIdentity.identityKey
recipientId:recipientId
direction:TSMessageDirectionOutgoing];

Loading…
Cancel
Save