prevent NPE in GroupCreateActivity

Occurs when a returned Recipient is null when returning from contact
selection activity.

Fixes #2466
// FREEBIE
This commit is contained in:
Jake McGinty 2015-02-12 13:34:40 -08:00
parent 35dabaf1e5
commit 442f56cdc3

View File

@ -387,8 +387,9 @@ public class GroupCreateActivity extends PassphraseRequiredActionBarActivity {
Recipient recipient = RecipientFactory.getRecipientsFromString(this, numberData.number, false) Recipient recipient = RecipientFactory.getRecipientsFromString(this, numberData.number, false)
.getPrimaryRecipient(); .getPrimaryRecipient();
if (!selectedContacts.contains(recipient) if (!selectedContacts.contains(recipient) &&
&& (existingContacts == null || !existingContacts.contains(recipient))) { (existingContacts == null || !existingContacts.contains(recipient)) &&
recipient != null) {
addSelectedContact(recipient); addSelectedContact(recipient);
} }
} catch (RecipientFormattingException e) { } catch (RecipientFormattingException e) {