From 47c83d2747605ca010a267caa98b304af9312660 Mon Sep 17 00:00:00 2001
From: Moxie Marlinspike <moxie@thoughtcrime.org>
Date: Sun, 18 Nov 2012 14:51:20 -0800
Subject: [PATCH] When retrieving MMS, continue on with best-effort in absence
 of APNs.

---
 .../securesms/mms/MmsDownloadHelper.java           | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/org/thoughtcrime/securesms/mms/MmsDownloadHelper.java b/src/org/thoughtcrime/securesms/mms/MmsDownloadHelper.java
index 280aef8f92..d1f5334248 100644
--- a/src/org/thoughtcrime/securesms/mms/MmsDownloadHelper.java
+++ b/src/org/thoughtcrime/securesms/mms/MmsDownloadHelper.java
@@ -50,14 +50,16 @@ public class MmsDownloadHelper extends MmsCommunication {
   }
 
   public static byte[] retrieveMms(Context context, String url, String apn) throws IOException {
-    try {
-      MmsConnectionParameters connectionParameters = getMmsConnectionParameters(context, apn);
+    MmsConnectionParameters connectionParameters;
 
-      checkRouteToHost(context, connectionParameters, url);
-      return makeRequest(connectionParameters, url);
+    try {
+      connectionParameters = getMmsConnectionParameters(context, apn);
     } catch (MmsException me) {
-      Log.w("MmsDownloader", me);
-      throw new IOException("Problem configuring MmsConnectionParameters.");
+      Log.w("MmsDownloadHelper", me);
+      connectionParameters = new MmsConnectionParameters(null, null, null);
     }
+
+    checkRouteToHost(context, connectionParameters, url);
+    return makeRequest(connectionParameters, url);
   }
 }