mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-25 15:11:52 -05:00
Fix potential NPE.
This commit is contained in:
parent
f9f6160719
commit
74e6384236
@ -2325,13 +2325,14 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
/**
|
/**
|
||||||
* Add quoting markup to a message.
|
* Add quoting markup to a message.
|
||||||
* @param originalMessage Metadata for message being quoted.
|
* @param originalMessage Metadata for message being quoted.
|
||||||
* @param body Text of the message to be quoted.
|
* @param messageBody Text of the message to be quoted.
|
||||||
* @param quoteStyle Style of quoting.
|
* @param quoteStyle Style of quoting.
|
||||||
* @return Quoted text.
|
* @return Quoted text.
|
||||||
* @throws MessagingException
|
* @throws MessagingException
|
||||||
*/
|
*/
|
||||||
private String quoteOriginalMessage(final Message originalMessage, final String body, final Account.QuoteStyle quoteStyle) throws MessagingException
|
private String quoteOriginalMessage(final Message originalMessage, final String messageBody, final Account.QuoteStyle quoteStyle) throws MessagingException
|
||||||
{
|
{
|
||||||
|
String body = messageBody == null ? "" : messageBody;
|
||||||
if (quoteStyle == Account.QuoteStyle.PREFIX)
|
if (quoteStyle == Account.QuoteStyle.PREFIX)
|
||||||
{
|
{
|
||||||
StringBuilder quotedText = new StringBuilder(body.length() + QUOTE_BUFFER_LENGTH);
|
StringBuilder quotedText = new StringBuilder(body.length() + QUOTE_BUFFER_LENGTH);
|
||||||
@ -2377,10 +2378,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
}
|
}
|
||||||
quotedText.append("\n");
|
quotedText.append("\n");
|
||||||
|
|
||||||
if (body != null)
|
|
||||||
{
|
|
||||||
quotedText.append(body);
|
quotedText.append(body);
|
||||||
}
|
|
||||||
|
|
||||||
return quotedText.toString();
|
return quotedText.toString();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user