From 7f876c0375fd65d8796a96f137481a4c28593617 Mon Sep 17 00:00:00 2001 From: Ben Komalo Date: Fri, 15 Jul 2011 19:10:41 -0700 Subject: [PATCH] Fix possible NPE for messages with no subjects Bug: 5038097 Change-Id: I0952158017c0d512998f423ecd38722a5b6b8afc --- src/com/android/email/activity/MessageListItem.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/com/android/email/activity/MessageListItem.java b/src/com/android/email/activity/MessageListItem.java index 3c013bded..8f24a2351 100644 --- a/src/com/android/email/activity/MessageListItem.java +++ b/src/com/android/email/activity/MessageListItem.java @@ -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; }