From aba577444686c9a2846c6e5fc0810e2cc587aff2 Mon Sep 17 00:00:00 2001 From: Cody Henthorne Date: Mon, 28 Jun 2021 16:40:14 -0400 Subject: [PATCH] Fix share contact list updating improperly on selection change. --- .../securesms/contacts/ContactSelectionListItem.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListItem.java b/app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListItem.java index 970541c09f..e8073eca22 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListItem.java +++ b/app/src/main/java/org/thoughtcrime/securesms/contacts/ContactSelectionListItem.java @@ -189,7 +189,11 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientF @Override public void onRecipientChanged(@NonNull Recipient recipient) { - contactPhotoImage.setAvatar(glideRequests, recipient, false); - setText(recipient, contactType, contactName, contactNumber, contactLabel, contactAbout); + if (this.recipient != null && this.recipient.getId().equals(recipient.getId())) { + contactPhotoImage.setAvatar(glideRequests, recipient, false); + setText(recipient, contactType, contactName, contactNumber, contactLabel, contactAbout); + } else { + Log.w(TAG, "Bad change! Local recipient doesn't match. Ignoring. Local: " + (this.recipient == null ? "null" : this.recipient.getId()) + ", Changed: " + recipient.getId()); + } } }