Fix NPE
bug: 5290369
Change-Id: Ica450c49fc0bc89b1697eaa1086707f481f6be7e
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 e406a0c..f793af9 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 @@
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);