summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2015-09-04 16:44:27 -0700
committerLorDClockaN <davor@losinj.com>2015-09-05 05:59:36 +0200
commit2cf48f8dacd045d42df2e1349d714b10618e505e (patch)
treedc066f47c7515abb955c20fbf01096b6ec50e887
parent2a287b7ef68eb38e0951976e0cdc960764de42e5 (diff)
Mms: Don't try to send an SMS to a null destination.
Throw an MmsException which can be handled by the SmsWorker and bubbled up to the UI. Change-Id: I30b0dfb5463a88e9126d6213e1855c9a07fe37df TICKET: CYNGNOS-921
-rw-r--r--src/com/android/mms/transaction/SmsSingleRecipientSender.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/mms/transaction/SmsSingleRecipientSender.java b/src/com/android/mms/transaction/SmsSingleRecipientSender.java
index 168cfce6..1e567403 100644
--- a/src/com/android/mms/transaction/SmsSingleRecipientSender.java
+++ b/src/com/android/mms/transaction/SmsSingleRecipientSender.java
@@ -50,6 +50,10 @@ public class SmsSingleRecipientSender extends SmsMessageSender {
// one.
throw new MmsException("Null message body or have multiple destinations.");
}
+ if (mDest == null) {
+ // Don't try to send a message to an invalid destination
+ throw new MmsException("No destinations");
+ }
SmsManager smsManager = SmsManager.getSmsManagerForSubscriptionId(mSubId);
ArrayList<String> messages = null;
if ((MmsConfig.getEmailGateway() != null) &&