Skip to content
Snippets Groups Projects
Commit 5cb10f78 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Fix possible NPE

Bug: 5171442
Change-Id: I280f6a0ef5fb06f1e03e17c0065d078604e4747a
parent 1d66cc1b
No related branches found
No related tags found
No related merge requests found
...@@ -633,6 +633,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo ...@@ -633,6 +633,7 @@ public class CandidateView extends LinearLayout implements OnClickListener, OnLo
private static CharSequence getEllipsizedText(CharSequence text, int maxWidth, private static CharSequence getEllipsizedText(CharSequence text, int maxWidth,
TextPaint paint) { TextPaint paint) {
if (text == null) return null;
paint.setTextScaleX(1.0f); paint.setTextScaleX(1.0f);
final int width = getTextWidth(text, paint); final int width = getTextWidth(text, paint);
if (width <= maxWidth) { if (width <= maxWidth) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment