am 2435eb9c: Avoid NPE when finding common MIME type.
Jeff Sharkey [Thu, 9 May 2013 23:23:24 +0000 (16:23 -0700)]
* commit '2435eb9c89bd46511624b9d89ab22766f82dbfcb':
  Avoid NPE when finding common MIME type.

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

index db86ab7..05b5d75 100644 (file)
@@ -734,7 +734,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));