Commit 6322b0ed authored by Finnur Thorarinsson's avatar Finnur Thorarinsson Committed by Commit Bot

[Android] Photo Picker: Fix crash when content resolver returns null.

According to the documentation, this can occur if the underlying
content provider returns null or crashes.

Bug: 1056911, 656015
Change-Id: I8171b0aa0b4b44093ff95660e47fee2473619b20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2083021
Auto-Submit: Finnur Thorarinsson <finnur@chromium.org>
Commit-Queue: Theresa  <twellington@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745960}
parent 783ef8ee
......@@ -160,6 +160,11 @@ class FileEnumWorkerTask extends AsyncTask<List<PickerBitmap>> {
Cursor imageCursor =
mContentResolver.query(contentUri, selectColumns, whereClause, whereArgs, orderBy);
if (imageCursor == null) {
Log.e(TAG, "Content Resolver query() returned null");
return null;
}
Log.i(TAG,
"Found " + imageCursor.getCount() + " media files, when requesting columns: "
+ Arrays.toString(selectColumns) + ", with WHERE " + whereClause
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment