Merge "Fix possible NPE for messages with no subjects"

This commit is contained in:
Ben Komalo 2011-07-17 15:03:35 -07:00 committed by Android (Google) Code Review
commit 14ea7d7bbc

View File

@ -16,9 +16,6 @@
package com.android.email.activity;
import com.android.email.R;
import com.android.emailcommon.utility.TextUtilities;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
@ -42,6 +39,10 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.accessibility.AccessibilityEvent;
import com.android.email.R;
import com.android.emailcommon.utility.TextUtilities;
import com.google.common.base.Objects;
/**
* This custom View is the list item for the MessageList activity, and serves two purposes:
* 1. It's a container to store message metadata (e.g. the ids of the message, mailbox, & account)
@ -185,7 +186,7 @@ public class MessageListItem extends View {
* Sets message subject safely, ensuring the cache is invalidated.
*/
public void setSubject(String subject) {
if (!subject.equals(mSubject)) {
if (!Objects.equal(mSubject, subject)) {
mSubject = subject;
mSubjectAndDescription = null;
}