From fe402a80816f2fe12d9fac78474b093ffb4515b1 Mon Sep 17 00:00:00 2001 From: Mindy Pereira Date: Mon, 28 Nov 2011 11:23:28 -0800 Subject: [PATCH] Check for account before launching welcome screen. If this is running via monkey, might not have an account yet. fixes b/5518958 java.lang.NullPointerException at com.android.email.activity.MessageCompose.onBack(MessageCompose.java:1797) Change-Id: I17fb606a2fd3aad685a855ae8bd9eda551296ca3 --- src/com/android/email/activity/MessageCompose.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/email/activity/MessageCompose.java b/src/com/android/email/activity/MessageCompose.java index 543932b74..e8e169320 100644 --- a/src/com/android/email/activity/MessageCompose.java +++ b/src/com/android/email/activity/MessageCompose.java @@ -1778,7 +1778,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus return; } - if (isOpenedFromWidget() || !systemKey) { + if ((isOpenedFromWidget() || !systemKey) && (mAccount != null)) { // Otherwise, need to open the main screen for the appropriate account. // Note that mAccount should always be set by the time the action bar is set up. startActivity(Welcome.createOpenAccountInboxIntent(this, mAccount.mId));