From 337729c681aff03ca9e1a8fb4031c6b8e3892978 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Fri, 15 Jun 2012 17:35:59 -0700 Subject: [PATCH] Fix NPE in uiSaveMessage Bug: 6675492 Change-Id: Ic63e4feacecd9b347402715dd31f0bd5fd962348 --- email2/src/com/android/email/provider/EmailProvider.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/email2/src/com/android/email/provider/EmailProvider.java b/email2/src/com/android/email/provider/EmailProvider.java index e01c3dbe7..e6cc0d63f 100644 --- a/email2/src/com/android/email/provider/EmailProvider.java +++ b/email2/src/com/android/email/provider/EmailProvider.java @@ -3234,9 +3234,12 @@ outer: break; } msg.mFlags = flags; - int draftInfo = values.getAsInteger(UIProvider.MessageColumns.QUOTE_START_POS); - if (values.getAsInteger(UIProvider.MessageColumns.APPEND_REF_MESSAGE_CONTENT) != 0) { - draftInfo |= Message.DRAFT_INFO_APPEND_REF_MESSAGE; + int draftInfo = 0; + if (values.containsKey(UIProvider.MessageColumns.QUOTE_START_POS)) { + draftInfo = values.getAsInteger(UIProvider.MessageColumns.QUOTE_START_POS); + if (values.getAsInteger(UIProvider.MessageColumns.APPEND_REF_MESSAGE_CONTENT) != 0) { + draftInfo |= Message.DRAFT_INFO_APPEND_REF_MESSAGE; + } } msg.mDraftInfo = draftInfo; String ref = values.getAsString(UIProvider.MessageColumns.REF_MESSAGE_ID);