Fix possible NPE
Bug: 5171442 Change-Id: I280f6a0ef5fb06f1e03e17c0065d078604e4747amain
parent
1d66cc1be6
commit
5cb10f78ed
|
@ -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 New Issue