mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Fix crash when getLayout() is null.
This commit is contained in:
@@ -153,7 +153,7 @@ public class EmojiTextView extends AppCompatTextView {
|
||||
@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
CharSequence text = getText();
|
||||
if (!measureLastLine || text == null || text.length() == 0) {
|
||||
if (getLayout() == null || !measureLastLine || text == null || text.length() == 0) {
|
||||
lastLineWidth = -1;
|
||||
} else {
|
||||
Layout layout = getLayout();
|
||||
@@ -175,7 +175,7 @@ public class EmojiTextView extends AppCompatTextView {
|
||||
}
|
||||
|
||||
public boolean isSingleLine() {
|
||||
return getLayout().getLineCount() == 1;
|
||||
return getLayout() != null && getLayout().getLineCount() == 1;
|
||||
}
|
||||
|
||||
public void setOverflowText(@Nullable CharSequence overflowText) {
|
||||
|
||||
@@ -387,7 +387,12 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
||||
}
|
||||
}
|
||||
|
||||
if (!updatingFooter && !isCaptionlessMms(messageRecord) && !isViewOnceMessage(messageRecord) && isFooterVisible(messageRecord, nextMessageRecord, groupThread)) {
|
||||
if (!updatingFooter &&
|
||||
!isCaptionlessMms(messageRecord) &&
|
||||
!isViewOnceMessage(messageRecord) &&
|
||||
isFooterVisible(messageRecord, nextMessageRecord, groupThread) &&
|
||||
bodyText.getLastLineWidth() > 0)
|
||||
{
|
||||
int footerWidth = footer.getMeasuredWidth();
|
||||
int availableWidth = getAvailableMessageBubbleWidth(bodyText);
|
||||
if (bodyText.isSingleLine()) {
|
||||
|
||||
Reference in New Issue
Block a user