From 4fdf1de47f945dbead411e9f7232cf714db35e9d Mon Sep 17 00:00:00 2001 From: satok Date: Thu, 6 Jan 2011 19:30:54 +0900 Subject: [PATCH] Check null pointer agressively. Bug: 3250622 Change-Id: I25f367ad1bd6a741282603f2f587f7a1256ef460 --- .../statusbar/tablet/InputMethodButton.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java index f5e677dc4df64..df4bfa1a5a6f5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java @@ -184,6 +184,9 @@ public class InputMethodButton extends ImageView { } private void refreshStatusIcon() { + if (mIcon == null) { + return; + } if (!needsToShowIMEButton()) { setVisibility(View.INVISIBLE); return; @@ -202,12 +205,10 @@ public class InputMethodButton extends ImageView { icon = getShortcutInputMethodAndSubtypeDrawable(); break; } - if (mIcon != null) { - if (icon == null) { - mIcon.setImageResource(R.drawable.ic_sysbar_ime_default); - } else { - mIcon.setImageDrawable(icon); - } + if (icon == null) { + mIcon.setImageResource(R.drawable.ic_sysbar_ime_default); + } else { + mIcon.setImageDrawable(icon); } }