diff options
author | Jay Shrauner <shrauner@google.com> | 2013-12-06 13:57:41 -0800 |
---|---|---|
committer | Jay Shrauner <shrauner@google.com> | 2014-03-01 18:28:50 +0000 |
commit | 2972350f83fe70e3be3792df9e1f3bd63a66b271 (patch) | |
tree | b48997a52d4652dc16c7271cef996238b3504ea1 /src | |
parent | b0b153f5fe5833d1a3b102e93e6e27481a90e4f7 (diff) |
Fix potential NPE in saveHorizontalOffsets
Fix potential NPE in saveHorizontalOffsets.
Bug:12031506
Change-Id: I713fed5995356bdaaf93186454dcc53b92cb75ec
(cherry picked from commit d0aa0f6fa23a345cbd117d3aa89e1dc95f857050)
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/dialer/list/PhoneFavoriteFragment.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/dialer/list/PhoneFavoriteFragment.java b/src/com/android/dialer/list/PhoneFavoriteFragment.java index 34666ee99..04611b4ec 100644 --- a/src/com/android/dialer/list/PhoneFavoriteFragment.java +++ b/src/com/android/dialer/list/PhoneFavoriteFragment.java @@ -453,8 +453,11 @@ public class PhoneFavoriteFragment extends Fragment implements OnItemClickListen } private void saveHorizontalOffsets(ContactTileRow row, ArrayList<ContactEntry> list) { - for (int i = 0; i < list.size(); i++) { + for (int i = 0; i < list.size() && i < row.getChildCount(); i++) { final View child = row.getChildAt(i); + if (child == null) { + continue; + } final ContactEntry entry = list.get(i); final long itemId = mContactTileAdapter.getAdjustedItemId(entry.id); if (DEBUG) { |