Fix possible NPE
Bug: 5171442 Change-Id: I280f6a0ef5fb06f1e03e17c0065d078604e4747a
This commit is contained in:
parent
1d66cc1be6
commit
5cb10f78ed
1 changed files with 1 additions and 0 deletions
|
@ -633,6 +633,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
|
|||
|
||||
private static CharSequence getEllipsizedText(CharSequence text, int maxWidth,
|
||||
TextPaint paint) {
|
||||
if (text == null) return null;
|
||||
paint.setTextScaleX(1.0f);
|
||||
final int width = getTextWidth(text, paint);
|
||||
if (width <= maxWidth) {
|
||||
|
|
Loading…
Reference in a new issue