really fix crash from incorrect send job

Closes #4246
// FREEBIE
This commit is contained in:
Jake McGinty 2015-10-26 11:02:23 -07:00 committed by Moxie Marlinspike
parent 7a0765c1c2
commit 758b306527

View File

@ -102,6 +102,13 @@ public class PushMediaSendJob extends PushSendJob implements InjectableType {
throws RetryLaterException, InsecureFallbackApprovalException, UntrustedIdentityException, throws RetryLaterException, InsecureFallbackApprovalException, UntrustedIdentityException,
UndeliverableMessageException UndeliverableMessageException
{ {
if (message.getRecipients() == null ||
message.getRecipients().getPrimaryRecipient() == null ||
message.getRecipients().getPrimaryRecipient().getNumber() == null)
{
throw new UndeliverableMessageException("No destination address.");
}
TextSecureMessageSender messageSender = messageSenderFactory.create(); TextSecureMessageSender messageSender = messageSenderFactory.create();
try { try {