From e281ebc4e2b69ded38e4448c07ca62031553a010 Mon Sep 17 00:00:00 2001 From: Mihai Preda Date: Mon, 15 Mar 2010 15:05:58 +0100 Subject: [PATCH] MessageView: reject early invalid messageId. Bug 2507898 Change-Id: I13148c49d9ad5ddfcf7a757e11651762fc8d1922 --- src/com/android/email/activity/MessageView.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/android/email/activity/MessageView.java b/src/com/android/email/activity/MessageView.java index 1e05622e3..e7d503e21 100644 --- a/src/com/android/email/activity/MessageView.java +++ b/src/com/android/email/activity/MessageView.java @@ -327,6 +327,9 @@ public class MessageView extends Activity implements OnClickListener { */ public static void actionView(Context context, long messageId, long mailboxId, boolean disableReplyAndForward) { + if (messageId < 0) { + throw new IllegalArgumentException("MessageView invalid messageId " + messageId); + } Intent i = new Intent(context, MessageView.class); i.putExtra(EXTRA_MESSAGE_ID, messageId); i.putExtra(EXTRA_MAILBOX_ID, mailboxId);