enforce NonNull on incoming MMS content location

Fixes #2959
Closes #2975

// FREEBIE
This commit is contained in:
Jake McGinty
2015-04-13 10:56:41 -07:00
committed by Moxie Marlinspike
parent 4a9028aedd
commit a28408b29f
4 changed files with 22 additions and 10 deletions

View File

@@ -77,14 +77,18 @@ public class MmsDownloadJob extends MasterSecretJob {
return;
}
database.markDownloadState(messageId, MmsDatabase.Status.DOWNLOAD_CONNECTING);
String contentLocation = new String(notification.get().getContentLocation());
byte[] transactionId = notification.get().getTransactionId();
Log.w(TAG, "Downloading mms at " + Uri.parse(contentLocation).getHost());
try {
if (notification.get().getContentLocation() == null) {
throw new MmsException("Notification content location was null.");
}
database.markDownloadState(messageId, MmsDatabase.Status.DOWNLOAD_CONNECTING);
String contentLocation = new String(notification.get().getContentLocation());
byte[] transactionId = notification.get().getTransactionId();
Log.w(TAG, "Downloading mms at " + Uri.parse(contentLocation).getHost());
RetrieveConf retrieveConf = getMmsConnection(context).retrieve(contentLocation, transactionId);
if (retrieveConf == null) {
throw new MmsException("RetrieveConf was null");