diff options
author | Jay Shrauner <shrauner@google.com> | 2014-03-03 22:18:31 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-03-03 22:18:32 +0000 |
commit | 906befb10305b4102e457c5e72ce76067f1d0438 (patch) | |
tree | 1368180af2e608d144c016cbe615d6645833e376 /src | |
parent | e53197e2de288b861138f9147a43cf143cedc0f8 (diff) | |
parent | 2972350f83fe70e3be3792df9e1f3bd63a66b271 (diff) |
Merge "Fix potential NPE in saveHorizontalOffsets" into klp-dev
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) { |