Avoid NPE when finding common MIME type. rel-roth-r2-partner rel-roth-r3-partner rel-tegranote-r3-partner daily-2013.10.28.1_rel-roth-r2-partner daily-2013.10.28.2_rel-roth-r2-partner daily-2013.10.29.0_rel-roth-r2-partner daily-2013.11.06.0_rel-roth-r2-partner daily-2013.12.03.0_rel-roth-r3-partner daily-2013.12.26.0_rel-roth-r3-partner daily-2014.01.08.0_rel-tegranote-r3-partner daily-2014.02.03.0_rel-roth-r3-partner
Jeff Sharkey [Thu, 9 May 2013 20:46:37 +0000 (13:46 -0700)]
Bug: 8609148
Change-Id: Ibd1121d6833981234acdc927010087c12913e33d

ui/src/com/android/providers/downloads/ui/DownloadList.java

index ed36993..fd000d3 100644 (file)
@@ -732,7 +732,9 @@ public class DownloadList extends Activity {
                         Downloads.Impl.ALL_DOWNLOADS_CONTENT_URI, item.getKey());
                 final String mimeType = item.getValue().getMimeType();
                 attachments.add(uri);
-                mimeTypes.add(mimeType);
+                if (mimeType != null) {
+                    mimeTypes.add(mimeType);
+                }
             }
             intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, attachments);
             intent.setType(findCommonMimeType(mimeTypes));