Fix NPE in MessageListItem
Not sure in what condition Message.displayName can be null, but addign this check won't harm... Bug 3339309 Change-Id: Ic2261fc33cf2be759411b998707a96eedd4e4fdb
This commit is contained in:
parent
f7b8bc1ed7
commit
0a73e8cd45
@ -328,7 +328,12 @@ public class MessageListItem extends View {
|
||||
TextPaint senderPaint = mRead ? sDefaultPaint : sBoldPaint;
|
||||
int senderWidth = (mMode == MODE_WIDE) ? sSenderWidth : mSenderSnippetWidth;
|
||||
// And get the ellipsized string for the calculated width
|
||||
mFormattedSender = TextUtils.ellipsize(mSender, senderPaint, senderWidth, TruncateAt.END);
|
||||
if (TextUtils.isEmpty(mSender)) {
|
||||
mFormattedSender = "";
|
||||
} else {
|
||||
mFormattedSender = TextUtils.ellipsize(mSender, senderPaint, senderWidth,
|
||||
TruncateAt.END);
|
||||
}
|
||||
// Get a nicely formatted date string (relative to today)
|
||||
String date = DateUtils.getRelativeTimeSpanString(getContext(), mTimestamp).toString();
|
||||
// And make it fit to our size
|
||||
|
Loading…
Reference in New Issue
Block a user