From 758b30652777a6fa9633abad2f9b1debdc1f3f72 Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Mon, 26 Oct 2015 11:02:23 -0700 Subject: [PATCH] really fix crash from incorrect send job Closes #4246 // FREEBIE --- src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java index 3b910f7b98..635a74ce0b 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java @@ -102,6 +102,13 @@ public class PushMediaSendJob extends PushSendJob implements InjectableType { throws RetryLaterException, InsecureFallbackApprovalException, UntrustedIdentityException, UndeliverableMessageException { + if (message.getRecipients() == null || + message.getRecipients().getPrimaryRecipient() == null || + message.getRecipients().getPrimaryRecipient().getNumber() == null) + { + throw new UndeliverableMessageException("No destination address."); + } + TextSecureMessageSender messageSender = messageSenderFactory.create(); try {