From e00633e49a7136e14da8ce9938cf6a3333f28498 Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Mon, 12 Sep 2011 12:01:25 +0900 Subject: [PATCH] Fix NPE bug: 5290369 Change-Id: Ica450c49fc0bc89b1697eaa1086707f481f6be7e --- .../systemui/statusbar/tablet/InputMethodsPanel.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java index e406a0cf7b54e..f793af9fb1126 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java @@ -218,8 +218,12 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, private View createInputMethodItem( final InputMethodInfo imi, final InputMethodSubtype subtype) { - final CharSequence subtypeName = subtype.overridesImplicitlyEnabledSubtype() - ? null : getSubtypeName(imi, subtype); + final CharSequence subtypeName; + if (subtype == null || subtype.overridesImplicitlyEnabledSubtype()) { + subtypeName = null; + } else { + subtypeName = getSubtypeName(imi, subtype); + } final CharSequence imiName = getIMIName(imi); final Drawable icon = getSubtypeIcon(imi, subtype); final View view = View.inflate(mContext, R.layout.status_bar_input_methods_item, null);