Handle nil state on session reset.

pull/33/head
Mikunj 6 years ago
parent 28bc6b3714
commit 99cfe7ca24

@ -105,7 +105,9 @@ NSString *const kNSNotificationKey_ContactPubKey = @"kNSNotificationKey_ContactP
{
SessionRecord *record = [self.sessionStore loadSession:self.recipientId deviceId:self.deviceId protocolContext:protocolContext];
[record removePreviousSessionStates];
[record setState:state];
SessionState *newState = state == nil ? [SessionState new] : state;
[record setState:newState];
[self.sessionStore storeSession:self.recipientId deviceId:self.deviceId session:record protocolContext:protocolContext];
}

Loading…
Cancel
Save