Commit 653a3ff3 authored by Finnur Thorarinsson's avatar Finnur Thorarinsson Committed by Commit Bot

Android Photo Picker: Fix crash.

When an onSelectionStateChange comes in, it is not safe to
call super while mBitmapDetails is null, because it may in
some cases call back into us (like the crash dumps are
showing).

Bug: 1006823, 656015
Change-Id: Ia487d8e304d940ab7d681b39189c72d30c12ac8c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829707
Auto-Submit: Finnur Thorarinsson <finnur@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Finnur Thorarinsson <finnur@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701485}
parent e6257953
......@@ -175,8 +175,6 @@ public class PickerBitmapView extends SelectableItemView<PickerBitmap> {
@Override
public void onSelectionStateChange(List<PickerBitmap> selectedItems) {
super.onSelectionStateChange(selectedItems);
// If the user cancels the dialog before this object has initialized,
// the SelectionDelegate will try to notify us that all selections have
// been cleared. However, we don't need to process that message and, in
......@@ -184,6 +182,8 @@ public class PickerBitmapView extends SelectableItemView<PickerBitmap> {
// being initialized.
if (mBitmapDetails == null) return;
super.onSelectionStateChange(selectedItems);
updateSelectionState();
if (!isPictureTile()) return;
......
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