Move null recipients check

// FREEBIE

Closes #5800
This commit is contained in:
Moxie Marlinspike 2016-11-28 09:14:44 -08:00
parent 69b102bfe3
commit ed8215de81

View File

@ -1367,6 +1367,11 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
private void sendMessage() { private void sendMessage() {
try { try {
Recipients recipients = getRecipients(); Recipients recipients = getRecipients();
if (recipients == null) {
throw new RecipientFormattingException("Badly formatted");
}
boolean forceSms = sendButton.isManualSelection() && sendButton.getSelectedTransport().isSms(); boolean forceSms = sendButton.isManualSelection() && sendButton.getSelectedTransport().isSms();
int subscriptionId = sendButton.getSelectedTransport().getSimSubscriptionId().or(-1); int subscriptionId = sendButton.getSelectedTransport().getSimSubscriptionId().or(-1);
long expiresIn = recipients.getExpireMessages() * 1000; long expiresIn = recipients.getExpireMessages() * 1000;
@ -1374,10 +1379,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
Log.w(TAG, "isManual Selection: " + sendButton.isManualSelection()); Log.w(TAG, "isManual Selection: " + sendButton.isManualSelection());
Log.w(TAG, "forceSms: " + forceSms); Log.w(TAG, "forceSms: " + forceSms);
if (recipients == null) {
throw new RecipientFormattingException("Badly formatted");
}
if ((!recipients.isSingleRecipient() || recipients.isEmailRecipient()) && !isMmsEnabled) { if ((!recipients.isSingleRecipient() || recipients.isEmailRecipient()) && !isMmsEnabled) {
handleManualMmsRequired(); handleManualMmsRequired();
} else if (attachmentManager.isAttachmentPresent() || !recipients.isSingleRecipient() || recipients.isGroupRecipient() || recipients.isEmailRecipient()) { } else if (attachmentManager.isAttachmentPresent() || !recipients.isSingleRecipient() || recipients.isGroupRecipient() || recipients.isEmailRecipient()) {