diff options
author | John Reck <jreck@google.com> | 2011-09-12 13:34:16 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2011-09-12 15:45:35 -0700 |
commit | 4eb475de8265a4d177580a137a6a7148aaec1380 (patch) | |
tree | 3c92ae2469e8769599d6984da5280b54680f99cf /src | |
parent | 15f4ed021e219da5375a2b0d406175f08a590026 (diff) | |
download | packages_apps_Browser-4eb475de8265a4d177580a137a6a7148aaec1380.zip packages_apps_Browser-4eb475de8265a4d177580a137a6a7148aaec1380.tar.gz packages_apps_Browser-4eb475de8265a4d177580a137a6a7148aaec1380.tar.bz2 |
Add sanity checking to bookmark click listener
Bug: 5296561
Monkey manages to make the impossible happen - sanity check the state
of the world.
Change-Id: Ibbe62e6bd564d98af570271fa834dc9472c06126
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/browser/view/BookmarkExpandableView.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/browser/view/BookmarkExpandableView.java b/src/com/android/browser/view/BookmarkExpandableView.java index 44a123a..4fb09c4 100644 --- a/src/com/android/browser/view/BookmarkExpandableView.java +++ b/src/com/android/browser/view/BookmarkExpandableView.java @@ -264,8 +264,15 @@ public class BookmarkExpandableView extends ExpandableListView @Override public void onClick(View v) { + if (v.getVisibility() != View.VISIBLE) { + return; + } int groupPosition = (Integer) v.getTag(R.id.group_position); int childPosition = (Integer) v.getTag(R.id.child_position); + if (mAdapter.getGroupCount() <= groupPosition + || mAdapter.mChildren.get(groupPosition).getCount() <= childPosition) { + return; + } long id = (Long) v.getTag(R.id.child_id); if (mOnChildClickListener != null) { mOnChildClickListener.onChildClick(BookmarkExpandableView.this, |