From 6d1271aee78f195e094aca650d8dceee79fbb5e4 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Wed, 9 Sep 2009 11:14:48 -0700 Subject: [PATCH] Fix crash in large tests (#2108431) Change-Id: I82a0ec81361b722bfa1cb4f197e3c999936ff192 --- src/com/android/email/activity/MessageCompose.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/com/android/email/activity/MessageCompose.java b/src/com/android/email/activity/MessageCompose.java index 59aad1636..462847cb4 100644 --- a/src/com/android/email/activity/MessageCompose.java +++ b/src/com/android/email/activity/MessageCompose.java @@ -672,12 +672,14 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus String action = getIntent().getAction(); // Use the Intent to set flags saying this message is a reply or a forward and save the // unique id of the source message - if (ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action)) { - message.mFlags |= Message.FLAG_TYPE_REPLY; - message.mSourceKey = mSource.mId; - } else if (ACTION_FORWARD.equals(action)) { - message.mFlags |= Message.FLAG_TYPE_FORWARD; - message.mSourceKey = mSource.mId; + if (mSource != null) { + if (ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action)) { + message.mFlags |= Message.FLAG_TYPE_REPLY; + message.mSourceKey = mSource.mId; + } else if (ACTION_FORWARD.equals(action)) { + message.mFlags |= Message.FLAG_TYPE_FORWARD; + message.mSourceKey = mSource.mId; + } } }