mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-26 19:56:02 +01: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) {
|
||||
|
||||
Reference in New Issue
Block a user