Avoid NPE when finding common MIME type.

Bug: 8609148
Change-Id: Ibd1121d6833981234acdc927010087c12913e33d
diff --git a/ui/src/com/android/providers/downloads/ui/DownloadList.java b/ui/src/com/android/providers/downloads/ui/DownloadList.java
index ed36993..fd000d3 100644
--- a/ui/src/com/android/providers/downloads/ui/DownloadList.java
+++ b/ui/src/com/android/providers/downloads/ui/DownloadList.java
@@ -732,7 +732,9 @@
                         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));