summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJay Shrauner <shrauner@google.com>2013-12-06 13:57:41 -0800
committerJay Shrauner <shrauner@google.com>2014-03-01 18:28:50 +0000
commit2972350f83fe70e3be3792df9e1f3bd63a66b271 (patch)
treeb48997a52d4652dc16c7271cef996238b3504ea1 /src
parentb0b153f5fe5833d1a3b102e93e6e27481a90e4f7 (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.java5
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) {