Fix crash when syncing system contacts without local account data.

This commit is contained in:
Greyson Parrelli
2026-08-24 10:24:42 -04:00
parent 0cb52f8c58
commit f53056975d
2 changed files with 10 additions and 0 deletions
@@ -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(),