Guard against potential NPE.

Change-Id: I379da1f478b1b1fd1e488dbeff249cc10e3d48d5
This commit is contained in:
Yu Ping Hu 2013-03-21 18:49:55 -07:00
parent 5a3aebbd2d
commit 861c5c8c9e
1 changed files with 3 additions and 1 deletions

View File

@ -525,7 +525,9 @@ public abstract class EmailServiceStub extends IEmailService.Stub implements IEm
// 3. loop through the available messages and send them
while (c.moveToNext()) {
long messageId = -1;
moveToSentValues.remove(EmailContent.MessageColumns.FLAGS);
if (moveToSentValues != null) {
moveToSentValues.remove(EmailContent.MessageColumns.FLAGS);
}
try {
messageId = c.getLong(0);
// Don't send messages with unloaded attachments