Fix possible NPE

Bug: 5171442
Change-Id: I280f6a0ef5fb06f1e03e17c0065d078604e4747a
main
Tadashi G. Takaoka 2011-08-16 17:30:44 -07:00
parent 1d66cc1be6
commit 5cb10f78ed
1 changed files with 1 additions and 0 deletions

View File

@ -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) {