From c6a392937e755aba1593d45cea285f43c8edba3c Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Sat, 26 Sep 2009 10:04:26 -0700 Subject: [PATCH] Fix NPE issue in empty MessageList (fixes #2147432) Change-Id: Idea4e4193e95686411f8e8257d729fcfc14d50b5 --- src/com/android/email/activity/MessageList.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/android/email/activity/MessageList.java b/src/com/android/email/activity/MessageList.java index 2ba3d7c73..c607fc64c 100644 --- a/src/com/android/email/activity/MessageList.java +++ b/src/com/android/email/activity/MessageList.java @@ -359,7 +359,10 @@ public class MessageList extends ListActivity implements OnItemClickListener, On mSavedItemPosition = getListView().getFirstVisiblePosition(); if (mSavedItemPosition >= 0) { mSavedItemTop = 0; - mSavedItemTop = getListView().getChildAt(0).getTop(); + View topChild = getListView().getChildAt(0); + if (topChild != null) { + mSavedItemTop = topChild.getTop(); + } } } }