kopia lustrzana https://github.com/ryukoposting/Signal-Android
Prevent crash when adding group member by username.
rodzic
4de27482bb
commit
b9fc36be5a
|
@ -667,7 +667,7 @@ public final class ContactSelectionListFragment extends LoggingFragment
|
|||
SelectedContact selectedContact = contact.isUsernameType() ? SelectedContact.forUsername(contact.getRecipientId().orElse(null), contact.getNumber())
|
||||
: SelectedContact.forPhone(contact.getRecipientId().orElse(null), contact.getNumber());
|
||||
|
||||
if (!canSelectSelf && Recipient.self().getId().equals(selectedContact.getOrCreateRecipientId(requireContext()))) {
|
||||
if (!canSelectSelf && !selectedContact.hasUsername() && Recipient.self().getId().equals(selectedContact.getOrCreateRecipientId(requireContext()))) {
|
||||
Toast.makeText(requireContext(), R.string.ContactSelectionListFragment_you_do_not_need_to_add_yourself_to_the_group, Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,10 @@ public final class SelectedContact {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean hasUsername() {
|
||||
return username != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when non-null recipient ids match, and false if not.
|
||||
* <p>
|
||||
|
|
Ładowanie…
Reference in New Issue