mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-09-20 08:45:50 +01:00
Fix crash when syncing system contacts without local account data.
This commit is contained in:
@@ -42,6 +42,11 @@ public class ContactsSyncAdapter extends AbstractThreadedSyncAdapter {
|
||||
|
||||
Context context = getContext();
|
||||
|
||||
if (SignalStore.account().getAci() == null && SignalStore.account().getE164() == null) {
|
||||
Log.i(TAG, "No local account data set, skipping all sync operations.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SignalStore.account().isRegistered() || SignalStore.account().getAci() == null) {
|
||||
Log.i(TAG, "Not push registered. Just syncing contact info.");
|
||||
ContactDiscovery.syncRecipientInfoWithSystemContacts(context);
|
||||
|
||||
@@ -136,6 +136,11 @@ object ContactDiscovery {
|
||||
return
|
||||
}
|
||||
|
||||
if (!Recipient.isSelfSet) {
|
||||
Log.w(TAG, "[syncRecipientInfoWithSystemContacts] No self recipient yet, skipping.")
|
||||
return
|
||||
}
|
||||
|
||||
syncRecipientsWithSystemContacts(
|
||||
context = context,
|
||||
rewrites = emptyMap(),
|
||||
|
||||
Reference in New Issue
Block a user