From 4d2bbfc54d2a6995570fb3577c85e8911d5b576c Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Mon, 19 Nov 2018 13:10:59 -0500 Subject: [PATCH] Fix crash around account attributes update when unregistered. --- SignalServiceKit/src/Account/TSAccountManager.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SignalServiceKit/src/Account/TSAccountManager.m b/SignalServiceKit/src/Account/TSAccountManager.m index 01b124339..1dd7130e8 100644 --- a/SignalServiceKit/src/Account/TSAccountManager.m +++ b/SignalServiceKit/src/Account/TSAccountManager.m @@ -649,6 +649,10 @@ NSString *const TSAccountManager_NeedsAccountAttributesUpdateKey = @"TSAccountMa } - (AnyPromise *)updateAccountAttributesIfNecessary { + if (!self.isRegistered) { + return [AnyPromise promiseWithValue:@(1)]; + } + NSDate *_Nullable updateRequestDate = [self.dbConnection objectForKey:TSAccountManager_NeedsAccountAttributesUpdateKey inCollection:TSAccountManager_UserAccountCollection];