From 5cb10f78ed5c0e17798ea5300d8291b613c5e2a9 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Tue, 16 Aug 2011 17:30:44 -0700 Subject: [PATCH] Fix possible NPE Bug: 5171442 Change-Id: I280f6a0ef5fb06f1e03e17c0065d078604e4747a --- java/src/com/android/inputmethod/latin/CandidateView.java | 1 + 1 file changed, 1 insertion(+) diff --git a/java/src/com/android/inputmethod/latin/CandidateView.java b/java/src/com/android/inputmethod/latin/CandidateView.java index 0640fd0b1..b5b59ac12 100644 --- a/java/src/com/android/inputmethod/latin/CandidateView.java +++ b/java/src/com/android/inputmethod/latin/CandidateView.java @@ -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) {