From 2435eb9c89bd46511624b9d89ab22766f82dbfcb Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Thu, 9 May 2013 13:46:37 -0700 Subject: Avoid NPE when finding common MIME type. Bug: 8609148 Change-Id: Ibd1121d6833981234acdc927010087c12913e33d --- ui/src/com/android/providers/downloads/ui/DownloadList.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/src/com/android/providers/downloads/ui/DownloadList.java b/ui/src/com/android/providers/downloads/ui/DownloadList.java index ed369932..fd000d3c 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 @@ 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)); -- cgit v1.2.3